添加光芯生产执行页面

This commit is contained in:
shijing 2024-07-15 13:45:01 +08:00
parent 5293d8150a
commit f6e8b82101
19 changed files with 2045 additions and 189 deletions

View File

@ -1,337 +1,342 @@
import config from "@/config" import config from "@/config";
import http from "@/utils/request" import http from "@/utils/request";
/*EM接口*/ /*EM接口*/
export default { export default {
//值班记录 //值班记录
sflog: { sflog: {
list: { list: {
name: "值班记录列表", name: "值班记录列表",
req: async function(data){ req: async function (data) {
return await http.get( return await http.get(`${config.API_URL}/wpm/sflog/`, data);
`${config.API_URL}/wpm/sflog/`, },
data
);
}
}, },
item: { item: {
name: "获取详情", name: "获取详情",
req: async function(id){ req: async function (id) {
return await http.get( return await http.get(`${config.API_URL}/wpm/sflog/${id}/`);
`${config.API_URL}/wpm/sflog/${id}/` },
);
}
}, },
update: { update: {
name: "更新", name: "更新",
req: async function(id, data){ req: async function (id, data) {
return await http.put( return await http.put(
`${config.API_URL}/wpm/sflog/${id}/`, `${config.API_URL}/wpm/sflog/${id}/`,
data); data
} );
},
}, },
create: { create: {
name: "创建", name: "创建",
req: async function(data){ req: async function (data) {
return await http.post( return await http.post(`${config.API_URL}/wpm/sflog/`, data);
`${config.API_URL}/wpm/sflog/`, },
data);
}
}, },
delete: { delete: {
name: "删除", name: "删除",
req: async function(id){ req: async function (id) {
return await http.delete( return await http.delete(`${config.API_URL}/wpm/sflog/${id}/`);
`${config.API_URL}/wpm/sflog/${id}/`); },
}
}, },
deletes: { deletes: {
name: "批量删除", name: "批量删除",
req: async function(data){ req: async function (data) {
return await http.post( return await http.post(
`${config.API_URL}/wpm/sflog/deletes/`, `${config.API_URL}/wpm/sflog/deletes/`,
data); data
} );
},
}, },
cquery: { cquery: {
name: "复杂查询", name: "复杂查询",
req: async function(data){ req: async function (data) {
return await http.post( return await http.post(
`${config.API_URL}/wpm/sflog/cquery/`, `${config.API_URL}/wpm/sflog/cquery/`,
data); data
} );
},
}, },
deleteHard: { deleteHard: {
name: "批量物理删除", name: "批量物理删除",
req: async function(data){ req: async function (data) {
return await http.post( return await http.post(
`${config.API_URL}/wpm/sflog/deletes_hard/`, `${config.API_URL}/wpm/sflog/deletes_hard/`,
data); data
} );
},
}, },
init_test: { init_test: {
name: "初始化检测录入", name: "初始化检测录入",
req: async function(id){ req: async function (id) {
return await http.get( return await http.get(
`${config.API_URL}/wpm/sflog/${id}/init_test/` `${config.API_URL}/wpm/sflog/${id}/init_test/`
); );
} },
}, },
}, },
//异常记录 //异常记录
stlog: { stlog: {
list: { list: {
name: "异常记录列表", name: "异常记录列表",
req: async function(data){ req: async function (data) {
return await http.get( return await http.get(`${config.API_URL}/wpm/stlog/`, data);
`${config.API_URL}/wpm/stlog/`, },
data
);
}
}, },
item: { item: {
name: "获取详情", name: "获取详情",
req: async function(id){ req: async function (id) {
return await http.get( return await http.get(`${config.API_URL}/wpm/stlog/${id}/`);
`${config.API_URL}/wpm/stlog/${id}/` },
);
}
}, },
update: { update: {
name: "更新", name: "更新",
req: async function(id, data){ req: async function (id, data) {
return await http.put( return await http.put(
`${config.API_URL}/wpm/stlog/${id}/`, `${config.API_URL}/wpm/stlog/${id}/`,
data); data
} );
},
}, },
create: { create: {
name: "创建", name: "创建",
req: async function(data){ req: async function (data) {
return await http.post( return await http.post(`${config.API_URL}/wpm/stlog/`, data);
`${config.API_URL}/wpm/stlog/`, },
data);
}
}, },
delete: { delete: {
name: "删除", name: "删除",
req: async function(id){ req: async function (id) {
return await http.delete( return await http.delete(`${config.API_URL}/wpm/sflog/${id}/`);
`${config.API_URL}/wpm/sflog/${id}/`); },
}
}, },
}, },
sflogexp: { sflogexp: {
list: { list: {
name: "值班记录列表", name: "值班记录列表",
req: async function(data){ req: async function (data) {
return await http.get( return await http.get(`${config.API_URL}/wpm/sflogexp/`, data);
`${config.API_URL}/wpm/sflogexp/`, },
data
);
}
}, },
update: { update: {
name: "更新", name: "更新",
req: async function(id, data){ req: async function (id, data) {
return await http.put( return await http.put(
`${config.API_URL}/wpm/sflogexp/${id}/`, `${config.API_URL}/wpm/sflogexp/${id}/`,
data);
}
},
},
mlog:{
list: {
name: "值班记录列表",
req: async function(data){
return await http.get(
`${config.API_URL}/wpm/mlog/`,
data data
); );
} },
},
},
mlog: {
list: {
name: "值班记录列表",
req: async function (data) {
return await http.get(`${config.API_URL}/wpm/mlog/`, data);
},
}, },
item: { item: {
name: "获取详情", name: "获取详情",
req: async function(id){ req: async function (id) {
return await http.get( return await http.get(`${config.API_URL}/wpm/mlog/${id}/`);
`${config.API_URL}/wpm/mlog/${id}/` },
);
}
}, },
cquery: { cquery: {
name: "复杂查询", name: "复杂查询",
req: async function(data){ req: async function (data) {
return await http.post( return await http.post(
`${config.API_URL}/wpm/mlog/cquery/`, `${config.API_URL}/wpm/mlog/cquery/`,
data); data
} );
},
}, },
update: { update: {
name: "更新", name: "更新",
req: async function(id, data){ req: async function (id, data) {
return await http.put( return await http.put(
`${config.API_URL}/wpm/mlog/${id}/`, `${config.API_URL}/wpm/mlog/${id}/`,
data); data
} );
},
}, },
create: { create: {
name: "创建", name: "创建",
req: async function(data){ req: async function (data) {
return await http.post( return await http.post(`${config.API_URL}/wpm/mlog/`, data);
`${config.API_URL}/wpm/mlog/`, },
data);
}
}, },
delete: { delete: {
name: "删除", name: "删除",
req: async function(id){ req: async function (id) {
return await http.delete( return await http.delete(`${config.API_URL}/wpm/mlog/${id}/`);
`${config.API_URL}/wpm/mlog/${id}/`);
}
}, },
relatedFirst:{ },
relatedFirst: {
name: "获取相关任务的第一道工序日志", name: "获取相关任务的第一道工序日志",
req: async function(data){ req: async function (data) {
return await http.post( return await http.post(
`${config.API_URL}/wpm/mlog/related_first/`, `${config.API_URL}/wpm/mlog/related_first/`,
data); data
}
},
submit:{
name: "提交",
req: async function(id){
return await http.post(
`${config.API_URL}/wpm/mlog/${id}/submit/`,
); );
}
}, },
revert:{ },
submit: {
name: "提交",
req: async function (id) {
return await http.post(
`${config.API_URL}/wpm/mlog/${id}/submit/`
);
},
},
revert: {
name: "撤回", name: "撤回",
req: async function(id, data){ req: async function (id, data) {
return await http.post( return await http.post(
`${config.API_URL}/wpm/mlog/${id}/revert/`, `${config.API_URL}/wpm/mlog/${id}/revert/`,
data data
); );
}
}
}, },
handover:{ },
list: { init: {
name: "值班记录列表", name: "初始化",
req: async function(data){ req: async function (data) {
return await http.get( return await http.post(
`${config.API_URL}/wpm/handover/`, `${config.API_URL}/wpm/mlog/init/`,
data data
); );
} },
},
},
mlogb: {
list: {
name: "列表",
req: async function (data) {
return await http.get(`${config.API_URL}/wpm/mlogb/`, data);
},
},
in: {
name: "创建",
req: async function (data) {
return await http.post(`${config.API_URL}/wpm/mlogb/in/`, data);
},
},
delIn: {
name: "删除",
req: async function (id) {
return await http.delete(
`${config.API_URL}/wpm/mlogb/in/${id}/`
);
},
},
},
handover: {
list: {
name: "值班记录列表",
req: async function (data) {
return await http.get(`${config.API_URL}/wpm/handover/`, data);
},
}, },
item: { item: {
name: "获取详情", name: "获取详情",
req: async function(id){ req: async function (id) {
return await http.get( return await http.get(`${config.API_URL}/wpm/handover/${id}/`);
`${config.API_URL}/wpm/handover/${id}/` },
);
}
}, },
cquery: { cquery: {
name: "复杂查询", name: "复杂查询",
req: async function(data){ req: async function (data) {
return await http.post( return await http.post(
`${config.API_URL}/wpm/handover/cquery/`, `${config.API_URL}/wpm/handover/cquery/`,
data); data
} );
},
}, },
update: { update: {
name: "更新", name: "更新",
req: async function(id, data){ req: async function (id, data) {
return await http.put( return await http.put(
`${config.API_URL}/wpm/handover/${id}/`, `${config.API_URL}/wpm/handover/${id}/`,
data); data
} );
},
}, },
create: { create: {
name: "创建", name: "创建",
req: async function(data){ req: async function (data) {
return await http.post( return await http.post(`${config.API_URL}/wpm/handover/`, data);
`${config.API_URL}/wpm/handover/`, },
data);
}
}, },
delete: { delete: {
name: "删除", name: "删除",
req: async function(id){ req: async function (id) {
return await http.delete( return await http.delete(
`${config.API_URL}/wpm/handover/${id}/`); `${config.API_URL}/wpm/handover/${id}/`
} );
}, },
genByMlogs:{ },
genByMlogs: {
name: "从生产日志生成交接记录", name: "从生产日志生成交接记录",
req: async function(data){ req: async function (data) {
return await http.post( return await http.post(
`${config.API_URL}/wpm/handover/gen_by_mlogs/`, `${config.API_URL}/wpm/handover/gen_by_mlogs/`,
data); data
} );
}, },
genByWm:{ },
genByWm: {
name: "从车间库存生成交接记录", name: "从车间库存生成交接记录",
req: async function(data){ req: async function (data) {
return await http.post( return await http.post(
`${config.API_URL}/wpm/handover/gen_by_wm/`, `${config.API_URL}/wpm/handover/gen_by_wm/`,
data); data
} );
},
}, },
submit: { submit: {
name: "提交", name: "提交",
req: async function(id){ req: async function (id) {
return await http.post( return await http.post(
`${config.API_URL}/wpm/handover/${id}/submit/`, `${config.API_URL}/wpm/handover/${id}/submit/`
); );
} },
} },
}, },
//车间库存 //车间库存
wmaterial: { wmaterial: {
list: { list: {
name: "车间库存", name: "车间库存",
req: async function(data){ req: async function (data) {
return await http.get( return await http.get(`${config.API_URL}/wpm/wmaterial/`, data);
`${config.API_URL}/wpm/wmaterial/`, },
data
);
}
}, },
batchs: { batchs: {
name: "获取车间出现过的批次号", name: "获取车间出现过的批次号",
req: async function(data){ req: async function (data) {
return await http.post( return await http.post(
`${config.API_URL}/wpm/wmaterial/batchs/`, `${config.API_URL}/wpm/wmaterial/batchs/`,
data);
}
}
},
otherlog:{
list: {
name: "其他生产日志",
req: async function(data){
return await http.get(
`${config.API_URL}/wpm/otherlog/`,
data data
); );
} },
},
},
otherlog: {
list: {
name: "其他生产日志",
req: async function (data) {
return await http.get(`${config.API_URL}/wpm/otherlog/`, data);
},
}, },
create: { create: {
name: "创建", name: "创建",
req: async function(data){ req: async function (data) {
return await http.post( return await http.post(`${config.API_URL}/wpm/otherlog/`, data);
`${config.API_URL}/wpm/otherlog/`, },
data);
}
}, },
delete: { delete: {
name: "删除", name: "删除",
req: async function(id){ req: async function (id) {
return await http.delete( return await http.delete(
`${config.API_URL}/wpm/otherlog/${id}/`); `${config.API_URL}/wpm/otherlog/${id}/`
} );
}, },
} },
} },
};

View File

@ -1213,6 +1213,109 @@ const routes = [
}, },
], ],
}, },
//光芯生产执行 wpm_gx
{
name: "wpm_gx",
path: "/wpm_gx",
meta: {
title: "生产执行gx",
icon: "el-icon-grid",
type: "menu",
perms: ["wpm"],
},
children: [
{
name: "qiepian",
path: "/wpm_gx/qiepian",
meta: {
title: "切片",
icon: "el-icon-files",
perms: ["wpm"],
},
component: "wpm_gx/qiepian",
},
{
name: "huohua",
path: "/wpm_gx/huohua",
meta: {
title: "活化",
icon: "el-icon-cellphone",
perms: ["wpm"],
},
component: "wpm_gx/huohua",
},
{
name: "heihua",
path: "/wpm_gx/heihua",
meta: {
title: "黑化",
icon: "el-icon-cellphone",
perms: ["wpm"],
},
component: "wpm_gx/heihua",
},
{
name: "shaojie",
path: "/wpm_gx/shaojie",
meta: {
title: "烧结",
icon: "el-icon-cellphone",
perms: ["wpm"],
},
component: "wpm_gx/shaojie",
},
{
name: "jianbo",
path: "/wpm_gx/jianbo",
meta: {
title: "减薄",
icon: "el-icon-cellphone",
perms: ["wpm"],
},
component: "wpm_gx/jianbo",
},
{
name: "jingdiao",
path: "/wpm_gx/jingdiao",
meta: {
title: "精雕",
icon: "el-icon-cellphone",
perms: ["wpm"],
},
component: "wpm_gx/jingdiao",
},
{
name: "mopao",
path: "/wpm_gx/mopao",
meta: {
title: "磨抛",
icon: "el-icon-cellphone",
perms: ["wpm"],
},
component: "wpm_gx/mopao",
},
{
name: "daojiao",
path: "/wpm_gx/daojiao",
meta: {
title: "倒角",
icon: "el-icon-cellphone",
perms: ["wpm"],
},
component: "wpm_gx/daojiao",
},
{
name: "chaoxi",
path: "/wpm_gx/chaoxi",
meta: {
title: "超洗",
icon: "el-icon-cellphone",
perms: ["wpm"],
},
component: "wpm_gx/chaoxi",
},
],
},
//检验管理 qm //检验管理 qm
{ {
name: "qm", name: "qm",

View File

@ -208,25 +208,25 @@
>颗粒物实测值</span >颗粒物实测值</span
>0.218 mg/ >0.218 mg/
<span class="infotitle">折算值</span <span class="infotitle">折算值</span
>0.218 mg/ >0.208 mg/
</div> </div>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<div> <div>
<span class="infotitle" <span class="infotitle"
>SO2实测值</span >SO2实测值</span
>0.218 mg/ >1.018 mg/
<span class="infotitle">折算值</span <span class="infotitle">折算值</span
>0.218 mg/ >1.118 mg/
</div> </div>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<div> <div>
<span class="infotitle" <span class="infotitle"
>NOX实测值</span >NOX实测值</span
>0.218 mg/ >1.523 mg/
<span class="infotitle">折算值</span <span class="infotitle">折算值</span
>0.218 mg/ >1.503 mg/
</div> </div>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">

View File

@ -0,0 +1,33 @@
<template>
<el-container>
<el-header
><el-segmented
v-model="values"
:options="options"
size="default"
></el-segmented
></el-header>
<el-main>
<log v-if="values == '日志'">日志 </log>
<handover v-else-if="values == '交接记录'"> 交接记录</handover>
<mio v-else>库存 </mio>
</el-main>
</el-container>
</template>
<script>
export default {
data() {
return {
options: ["日志", "交接记录", "库存"],
values: "日志",
};
},
methods: {
handleChange(value) {
this.value = value;
console.log("Selected value:", value);
},
},
};
</script>

View File

@ -0,0 +1,33 @@
<template>
<el-container>
<el-header
><el-segmented
v-model="values"
:options="options"
size="default"
></el-segmented
></el-header>
<el-main>
<log v-if="values == '日志'">日志 </log>
<handover v-else-if="values == '交接记录'"> 交接记录</handover>
<mio v-else>库存 </mio>
</el-main>
</el-container>
</template>
<script>
export default {
data() {
return {
options: ["日志", "交接记录", "库存"],
values: "日志",
};
},
methods: {
handleChange(value) {
this.value = value;
console.log("Selected value:", value);
},
},
};
</script>

View File

@ -0,0 +1,199 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-button
type="primary"
icon="el-icon-plus"
@click="table_add"
v-auth="'mgroup.create'"
>新增</el-button
>
</div>
<div class="right-panel">
<el-input
style="margin-right: 5px"
v-model="query.search"
placeholder="名称"
clearable
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
hidePagination
:params="params"
>
<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">
<template #default="scope">
<span
>{{ scope.row.process_cate }} -
{{ scope.row.process_name }}</span
>
</template>
</el-table-column>
<el-table-column
label="所属部门"
prop="belong_dept_name"
min-width="150"
></el-table-column>
<el-table-column
label="班次规则"
prop="shift_rule"
min-width="80"
></el-table-column>
<!-- <el-table-column label="能源监测" prop="need_enm" min-width="80">
<template #default="scope">
<span v-if="scope.row.need_enm"></span>
<span v-else></span>
</template>
</el-table-column> -->
<el-table-column
label="排序"
prop="sort"
min-width="80"
></el-table-column>
<el-table-column
label="创建时间"
prop="create_time"
min-width="150"
></el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="180"
>
<template #default="scope">
<el-button
link
size="small"
@click="table_edit(scope.row)"
v-auth="'mgroup.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="'mgroup.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 "./mlog_form.vue";
export default {
name: "mgroup",
components: {
saveDialog,
},
data() {
return {
// apiObj: this.$API.mtm.mgroup.list,
apiObj: null,
params: { cate: "photon" },
query: {},
dialog: {
save: false,
permission: false,
},
tableData: [],
selection: [],
cates_: {
section: "工序",
other: "其他",
},
};
},
mounted() {},
methods: {
//
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,33 @@
<template>
<el-container>
<el-header
><el-segmented
v-model="values"
:options="options"
size="default"
></el-segmented
></el-header>
<el-main>
<log v-if="values == '日志'">日志 </log>
<handover v-else-if="values == '交接记录'"> 交接记录</handover>
<mio v-else>库存 </mio>
</el-main>
</el-container>
</template>
<script>
export default {
data() {
return {
options: ["日志", "交接记录", "库存"],
values: "日志",
};
},
methods: {
handleChange(value) {
this.value = value;
console.log("Selected value:", value);
},
},
};
</script>

View File

@ -0,0 +1,33 @@
<template>
<el-container>
<el-header
><el-segmented
v-model="values"
:options="options"
size="default"
></el-segmented
></el-header>
<el-main>
<log v-if="values == '日志'">日志 </log>
<handover v-else-if="values == '交接记录'"> 交接记录</handover>
<mio v-else>库存 </mio>
</el-main>
</el-container>
</template>
<script>
export default {
data() {
return {
options: ["日志", "交接记录", "库存"],
values: "日志",
};
},
methods: {
handleChange(value) {
this.value = value;
console.log("Selected value:", value);
},
},
};
</script>

156
src/views/wpm_gx/inm.vue Normal file
View File

@ -0,0 +1,156 @@
<template>
<el-container>
<el-main class="nopadding">
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
hidePagination
:params="params"
>
<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">
<template #default="scope">
<span
>{{ scope.row.process_cate }} -
{{ scope.row.process_name }}</span
>
</template>
</el-table-column>
<el-table-column
label="所属部门"
prop="belong_dept_name"
min-width="150"
></el-table-column>
<el-table-column
label="班次规则"
prop="shift_rule"
min-width="80"
></el-table-column>
<!-- <el-table-column label="能源监测" prop="need_enm" min-width="80">
<template #default="scope">
<span v-if="scope.row.need_enm"></span>
<span v-else></span>
</template>
</el-table-column> -->
<el-table-column
label="排序"
prop="sort"
min-width="80"
></el-table-column>
<el-table-column
label="创建时间"
prop="create_time"
min-width="150"
></el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="180"
>
<template #default="scope">
<el-button
link
size="small"
@click="table_edit(scope.row)"
v-auth="'mgroup.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="'mgroup.delete'"
type="danger"
>删除</el-button
>
</template>
</el-popconfirm>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</template>
<script>
export default {
name: "mgroup",
data() {
return {
// apiObj: this.$API.mtm.mgroup.list,
apiObj: null,
params: { cate: "photon" },
query: {},
dialog: {
save: false,
permission: false,
},
tableData: [],
selection: [],
cates_: {
section: "工序",
other: "其他",
},
};
},
mounted() {},
methods: {
//
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></style>

View File

@ -0,0 +1,33 @@
<template>
<el-container>
<el-header
><el-segmented
v-model="values"
:options="options"
size="default"
></el-segmented
></el-header>
<el-main>
<log v-if="values == '日志'">日志 </log>
<handover v-else-if="values == '交接记录'"> 交接记录</handover>
<mio v-else>库存 </mio>
</el-main>
</el-container>
</template>
<script>
export default {
data() {
return {
options: ["日志", "交接记录", "库存"],
values: "日志",
};
},
methods: {
handleChange(value) {
this.value = value;
console.log("Selected value:", value);
},
},
};
</script>

View File

@ -0,0 +1,33 @@
<template>
<el-container>
<el-header
><el-segmented
v-model="values"
:options="options"
size="default"
></el-segmented
></el-header>
<el-main>
<log v-if="values == '日志'">日志 </log>
<handover v-else-if="values == '交接记录'"> 交接记录</handover>
<mio v-else>库存 </mio>
</el-main>
</el-container>
</template>
<script>
export default {
data() {
return {
options: ["日志", "交接记录", "库存"],
values: "日志",
};
},
methods: {
handleChange(value) {
this.value = value;
console.log("Selected value:", value);
},
},
};
</script>

View File

@ -0,0 +1,282 @@
<template>
<el-drawer
title="日志详情"
v-model="visible"
:size="'90%'"
destroy-on-close
@closed="$emit('closed')"
>
<div>
<el-card style="width: 100%" header="基本信息" shadow="hover">
<el-descriptions>
<el-descriptions-item label="工艺路线">{{
mlogItem.material_out_name
}}</el-descriptions-item>
<el-descriptions-item label="工段名称">{{
mlogItem.mgroup_name
}}</el-descriptions-item>
<el-descriptions-item label="生产设备">{{
mlogItem.equipment_name
}}</el-descriptions-item>
<el-descriptions-item label="预计工时">{{
mlogItem.hour_work
}}</el-descriptions-item>
<el-descriptions-item label="部门/车间">{{
mlogItem.belong_dept_name
}}</el-descriptions-item>
<el-descriptions-item label="处理人">{{
mlogItem.handle_user_name
}}</el-descriptions-item>
<el-descriptions-item label="开始时间">{{
mlogItem.work_start_time
}}</el-descriptions-item>
<el-descriptions-item label="创建时间">{{
mlogItem.create_time
}}</el-descriptions-item>
</el-descriptions>
<el-button
type="primary"
@click="mioSubmit"
v-auth="'mio.submit'"
v-if="mlogItem.state == 10"
>
编辑
</el-button>
</el-card>
<el-card style="width: 100%" header="输入信息" shadow="hover">
<div>
<el-button
type="primary"
icon="el-icon-plus"
@click="table_add"
>新增</el-button
>
</div>
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="params"
hidePagination
hideDo
>
<el-table-column type="index" width="50" />
<el-table-column
label="物料"
prop="material"
show-overflow-tooltip
>
<template #default="scope"
>{{ scope.row.material_name }}
</template>
</el-table-column>
<el-table-column label="批次号" prop="batch">
</el-table-column>
<el-table-column label="领用数量" prop="count_use">
</el-table-column>
<el-table-column
label="创建时间"
prop="create_time"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="100px"
>
<template #default="scope">
<el-button
link
type="danger"
@click="table_del(scope.row)"
v-if="mlogItem.state == 10"
>
删除
</el-button>
</template>
</el-table-column>
</scTable>
</el-card>
<el-card style="width: 100%" header="输出信息" shadow="hover">
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="params"
hidePagination
hideDo
>
<el-table-column type="index" width="50" />
<el-table-column
label="物料"
prop="material"
show-overflow-tooltip
>
<template #default="scope"
>{{ scope.row.material_name }}
</template>
</el-table-column>
<el-table-column label="批次号" prop="batch">
</el-table-column>
<el-table-column label="数量" prop="count">
</el-table-column>
<el-table-column label="不合格数量" prop="count_notok">
</el-table-column>
<el-table-column
label="创建时间"
prop="create_time"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="100px"
>
<template #default="scope">
<el-button
link
type="primary"
@click="table_check(scope.row)"
>
检验
</el-button>
<el-button
link
type="danger"
@click="check_reSet(scope.row)"
v-if="scope.row.test_date !== null"
>
撤回
</el-button>
<el-button
link
type="danger"
@click="table_del(scope.row)"
v-if="mlogItem.state == 10"
>
删除
</el-button>
</template>
</el-table-column>
</scTable>
</el-card>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
:mlog="mlogId"
:mgroup="mgroup"
@success="handleSaveSuccess"
@closed="dialog.save = false"
>
</save-dialog>
</div>
</el-drawer>
</template>
<script>
import saveDialog from "./mlogb_form.vue";
export default {
props: {
mlogId: {
type: String,
default: "",
},
},
components: {
saveDialog,
},
emits: ["success", "closed"],
data() {
return {
loading: false,
//
form: {},
dialog: {
save: false,
},
apiObj: null,
params: {
page: 0,
mlog: "",
},
mgroup: "",
mlogItem: {},
visible: false,
isSaveing: false,
options: [],
setFiltersVisible: false,
};
},
mounted() {
this.getMlogItem();
this.params.mlog = this.mlogId;
this.apiObj = this.$API.wpm.mlogb.list;
},
methods: {
open() {
this.visible = true;
},
getMlogItem() {
let that = this;
that.$API.wpm.mlog.item.req(that.mlogId).then((res) => {
that.mlogItem = res;
that.mgroup = res.mgroup;
that.belongDeptId = res.belong_dept;
});
},
//
setData(data) {
Object.assign(this.form, data);
this.getRoute(data.id);
},
table_add() {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open();
});
},
table_del(row) {
this.$confirm("确定删除吗?").then(() => {
this.$API.wpm.mlogb.delIn.req(row.id).then((res) => {
this.$message.success("操作成功");
this.$refs.table.refresh();
//inout
});
});
},
//
submit() {
let that = this;
that.$refs.dialogForm.validate(async (valid) => {
if (valid) {
that.isSaveing = true;
that.form.mgroup = that.mgroup;
if (that.mode === "add") {
that.$API.wpm.mlog.init.req(that.form).then((res) => {
that.isSaveing = false;
that.$emit("success");
that.visible = false;
that.$message.success("操作成功");
});
} else {
}
}
});
},
handleSaveSuccess() {},
//
setFilters(filters) {
this.selectionFilters = filters;
this.setFiltersVisible = true;
},
},
};
</script>
<style></style>

View File

@ -0,0 +1,248 @@
<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="work_start_time">
<el-date-picker
v-model="form.work_start_time"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
/>
</el-form-item>
<el-form-item label="间隔提醒">
<el-input-number
v-model="form.reminder_interval_list[0]"
:min="1"
style="width: 25%"
controls-position="right"
/>
<el-input-number
v-model="form.reminder_interval_list[1]"
:min="1"
style="width: 25%"
controls-position="right"
/>
<el-input-number
v-model="form.reminder_interval_list[2]"
:min="1"
style="width: 25%"
controls-position="right"
/>
<el-input-number
v-model="form.reminder_interval_list[3]"
:min="1"
style="width: 25%"
controls-position="right"
/>
</el-form-item>
<el-form-item label="生产路线" prop="route">
<el-select
v-model="form.route"
placeholder="生产路线"
clearable
style="width: 100%"
>
<el-option
v-for="item in routeOptions"
:key="item.id"
:label="item.process_name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="生产设备">
<el-select
v-model="form.equipment"
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-form-item label="操作人">
<el-select
v-model="form.handle_user"
placeholder="操作人"
clearable
style="width: 100%"
>
<el-option
v-for="item in userOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="form.note" clearable></el-input>
</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 = {
note: "",
route: "",
equipment: "",
handle_user: "",
work_start_time: "",
reminder_interval_list: [],
};
export default {
props: {
process: {
type: String,
default: "",
},
mgroup: {
type: String,
default: "",
},
},
emits: ["success", "closed"],
data() {
return {
loading: false,
mode: "add",
titleMap: {
add: "新增",
edit: "编辑",
show: "查看",
},
//
form: defaultForm,
//
rules: {
work_start_time: [
{
required: true,
message: "请选择生产开始时间",
trigger: "blur",
},
],
route: [
{
required: true,
message: "请选择生产路线",
trigger: "blur",
},
],
},
visible: false,
isSaveing: false,
options: [],
routeOptions: [],
userOptions: [],
setFiltersVisible: false,
};
},
mounted() {
this.getRoute();
this.getUser();
this.getEquipment();
},
methods: {
//
getUser() {
this.$API.system.user.list.req().then((res) => {
this.userOptions = res.results;
});
},
getEquipment() {
this.$API.em.equipment.list
.req({ page: 0, type: 10 })
.then((res) => {
this.options = res;
});
},
getRoute(id) {
let that = this;
that.$API.mtm.route.list
.req({ process: that.process, page: 0 })
.then((res) => {
that.routeOptions = res;
});
},
//
open(mode = "add") {
this.mode = mode;
this.visible = true;
return this;
},
//
setData(data) {
Object.assign(this.form, data);
this.getRoute(data.id);
},
setMgroup(id) {
this.form.mgroup = id;
},
//
submit() {
let that = this;
that.$refs.dialogForm.validate(async (valid) => {
if (valid) {
that.isSaveing = true;
that.form.mgroup = that.mgroup;
if (that.mode === "add") {
that.$API.wpm.mlog.init.req(that.form).then((res) => {
that.isSaveing = false;
that.$emit("success");
that.visible = false;
that.$message.success("操作成功");
});
} else {
// 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

@ -0,0 +1,158 @@
<template>
<el-dialog
title="添加日志详情"
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="关联任务">
<el-select
v-model="form.mtask"
placeholder="关联任务"
clearable
style="width: 100%"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.material_out_name"
:value="item.id"
>
<span>{{ item.material_out_name }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="批次号" prop="batch">
<el-input v-model="form.batch" />
</el-form-item>
<el-form-item label="领用数量">
<el-input-number
v-model="form.count_use"
:min="1"
controls-position="right"
/>
</el-form-item>
<!-- <el-form-item label="备注">
<el-input v-model="form.note" clearable></el-input>
</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 = {
mlog: "",
mtask: "",
batch: "",
count_use: "",
};
export default {
props: {
mlog: {
type: String,
default: "",
},
mgroup: {
type: String,
default: "",
},
},
emits: ["success", "closed"],
data() {
return {
loading: false,
mode: "add",
titleMap: {
add: "新增",
},
//
form: defaultForm,
//
rules: {
batch: [
{
required: true,
message: "请填写批次号",
trigger: "blur",
},
],
count_use: [
{
required: true,
message: "请填写领用数量",
trigger: "blur",
},
],
},
options: [],
visible: false,
isSaveing: false,
setFiltersVisible: false,
};
},
mounted() {
this.getMtask();
},
methods: {
open() {
this.visible = true;
},
getMtask() {
let that = this;
this.$API.pm.mtask.list
.req({ page: 0, mgroup: that.mgroup })
.then((res) => {
that.options = res;
});
},
//
submit() {
let that = this;
that.$refs.dialogForm.validate(async (valid) => {
if (valid) {
that.isSaveing = true;
that.form.mlog = that.mlog;
that.$API.wpm.mlogb.in
.req(that.form)
.then((res) => {
that.isSaveing = false;
that.$emit("success");
that.visible = false;
that.$message.success("操作成功");
})
.catch((err) => {
that.isSaveing = false;
});
}
});
},
//
setFilters(filters) {
this.selectionFilters = filters;
this.setFiltersVisible = true;
},
},
};
</script>
<style></style>

236
src/views/wpm_gx/mlogs.vue Normal file
View File

@ -0,0 +1,236 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-button
type="primary"
icon="el-icon-plus"
@click="table_add"
v-auth="'mgroup.create'"
>新增</el-button
>
</div>
<div class="right-panel">
<el-input
style="margin-right: 5px"
v-model="query.search"
placeholder="名称"
clearable
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div>
</el-header>
<el-main>
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
:params="params"
:query="params"
>
<el-table-column
label="#"
type="index"
width="50"
></el-table-column>
<el-table-column
label="生产路线"
prop="material_out_name"
min-width="100"
>
</el-table-column>
<el-table-column
label="预计工时"
prop="hour_work"
></el-table-column>
<el-table-column
label="工段名称"
prop="mgroup_name"
min-width="100"
></el-table-column>
<el-table-column
label="生产设备"
prop="equipment_name"
min-width="150"
></el-table-column>
<el-table-column
label="所属部门"
prop="belong_dept_name"
></el-table-column>
<el-table-column
label="处理人"
prop="handle_user_name"
></el-table-column>
<el-table-column
label="开始时间"
prop="work_start_time"
></el-table-column>
<el-table-column
label="创建时间"
prop="create_time"
></el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="180"
>
<template #default="scope">
<el-button
link
size="small"
@click="table_detail(scope.row)"
type="primary"
>详情</el-button
>
<el-divider direction="vertical"></el-divider>
<el-button
link
size="small"
@click="table_edit(scope.row)"
v-auth="'mgroup.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="'mgroup.delete'"
type="danger"
>删除</el-button
>
</template>
</el-popconfirm>
</template>
</el-table-column>
</scTable>
</el-main>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
:process="processId"
:mgroup="mgroupId"
@success="handleSaveSuccess"
@closed="dialog.save = false"
>
</save-dialog>
<detail-drawer
v-if="dialog.detail"
ref="detailDialog"
:mlogId="mlogId"
:mtask="mtask"
@closed="dialog.detail = false"
>
</detail-drawer>
</el-container>
</template>
<script>
import saveDialog from "./mlog_form.vue";
import detailDrawer from "./mlog_detail.vue";
export default {
props: {
mgroupName: {
type: String,
default: "",
},
},
name: "mlog",
components: {
saveDialog,
detailDrawer,
},
data() {
return {
apiObj: null,
params: { mgroup: "" },
query: {},
dialog: {
save: false,
detail: false,
},
tableData: [],
selection: [],
cates_: {
section: "工序",
other: "其他",
},
mtask: "",
mlogId: "",
processId: "",
processCate: "",
};
},
mounted() {
let that = this;
that.$API.mtm.mgroup.list
.req({ page: 0, search: that.mgroupName })
.then((res) => {
that.mgroupId = res[0].id;
that.processId = res[0].process;
that.processCate = res[0].process_cate;
that.params.mgroup = res[0].id;
that.apiObj = that.$API.wpm.mlog.list;
});
},
methods: {
//
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);
});
},
table_detail(row) {
this.mlogId = row.id;
this.dialog.detail = true;
this.$nextTick(() => {
this.$refs.detailDialog.open();
});
},
//
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></style>

View File

@ -0,0 +1,33 @@
<template>
<el-container>
<el-header
><el-segmented
v-model="values"
:options="options"
size="default"
></el-segmented
></el-header>
<el-main>
<log v-if="values == '日志'">日志 </log>
<handover v-else-if="values == '交接记录'"> 交接记录</handover>
<mio v-else>库存 </mio>
</el-main>
</el-container>
</template>
<script>
export default {
data() {
return {
options: ["日志", "交接记录", "库存"],
values: "日志",
};
},
methods: {
handleChange(value) {
this.value = value;
console.log("Selected value:", value);
},
},
};
</script>

143
src/views/wpm_gx/mtask.vue Normal file
View File

@ -0,0 +1,143 @@
<template>
<el-container>
<el-header>
<h2>任务列表</h2>
</el-header>
<el-main>
<scTable
ref="table"
:apiObj="apiObj"
:query="params"
row-key="id"
:params="params"
>
<el-table-column
label="#"
type="index"
width="50"
></el-table-column>
<el-table-column
label="产品名称"
prop="material_out_name"
show-overflow-tooltip
>
</el-table-column>
<el-table-column label="型号规格">
<template #default="scope">
<span v-if="scope.row.material_out_"
>{{ scope.row.material_out_.specification }}|{{
scope.row.material_out_.model
}}</span
>
</template>
</el-table-column>
<el-table-column
label="任务编号"
prop="number"
width="140"
show-overflow-tooltip
>
</el-table-column>
<el-table-column label="任务量" prop="count"> </el-table-column>
<el-table-column label="开始时间" prop="start_date">
</el-table-column>
<el-table-column label="结束时间" prop="end_date">
</el-table-column>
<el-table-column label="合格数" prop="count_ok">
</el-table-column>
<el-table-column label="状态" prop="state">
<template #default="scope">
<el-tag :type="elTagType(scope.row.state)">
{{ state_[scope.row.state] }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="60">
<template #default="scope">
<el-link
type="primary"
@click="mtask_submit(scope.row)"
v-auth="'mtask.submit'"
v-if="
scope.row.state != 40 && scope.row.state != 34
"
>提交
</el-link>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</template>
<script>
export default {
props: {
mgroupName: {
type: String,
default: "",
},
},
name: "mtask",
data() {
return {
apiObj: null,
params: { mgroup: "" },
query: {},
tableData: [],
selection: [],
cates_: {
section: "工序",
other: "其他",
},
type_: {
10: "primary",
20: "primary",
30: "primary",
34: "danger",
40: "success",
},
state_: {
10: "创建中",
20: "已下达",
30: "生产中",
34: "已终止",
40: "已提交",
},
};
},
mounted() {
let that = this;
that.$API.mtm.mgroup.list
.req({ page: 0, search: that.mgroupName })
.then((res) => {
that.mgroupId = res[0].id;
that.processId = res[0].process;
that.processCate = res[0].process_cate;
that.params.mgroup = res[0].id;
that.apiObj = this.$API.pm.mtask.list;
console.log("mgroupId", res[0].id);
});
},
methods: {
elTagType(state) {
return this.type_[state];
},
//
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></style>

View File

@ -0,0 +1,62 @@
<template>
<el-container>
<el-header>
<el-segmented
v-model="values"
:options="options"
size="default"
></el-segmented>
</el-header>
<el-main id="elMain" class="nopadding">
<!-- 日志 -->
<mlogs
v-if="values == '日志'"
:mgroupName="mgroupName"
style="height: 50%"
></mlogs>
<mtask
v-if="values == '日志'"
:mgroupName="mgroupName"
style="height: 50%"
></mtask>
<!-- 交接记录 -->
<handover
v-else-if="values == '交接记录'"
:mgroupName="mgroupName"
></handover>
<!-- 库存 -->
<inm v-else :mgroupName="mgroupName"></inm>
</el-main>
</el-container>
</template>
<script>
import inm from "./inm.vue";
import mlogs from "./mlogs.vue";
import mtask from "./mtask.vue";
import handover from "./handover.vue";
export default {
components: { inm, mlogs, mtask, handover },
data() {
return {
tableHieght: 200,
options: ["日志", "交接记录", "库存"],
values: "日志",
mgroupName: "切片",
mgroupId: "",
};
},
created() {},
mounted() {
let that = this;
let height = document.getElementById("elMain").clintHeight / 2;
that.tableHieght = height;
},
methods: {
handleChange(value) {
this.value = value;
console.log("Selected value:", value);
},
},
};
</script>

View File

@ -0,0 +1,33 @@
<template>
<el-container>
<el-header
><el-segmented
v-model="values"
:options="options"
size="default"
></el-segmented
></el-header>
<el-main>
<log v-if="values == '日志'">日志 </log>
<handover v-else-if="values == '交接记录'"> 交接记录</handover>
<mio v-else>库存 </mio>
</el-main>
</el-container>
</template>
<script>
export default {
data() {
return {
options: ["日志", "交接记录", "库存"],
values: "日志",
};
},
methods: {
handleChange(value) {
this.value = value;
console.log("Selected value:", value);
},
},
};
</script>