feat: 添加很多新页面

This commit is contained in:
caoqianming 2023-12-01 16:15:25 +08:00
parent ae4863529f
commit 5ce7ce250f
35 changed files with 3659 additions and 1304 deletions

View File

@ -79,10 +79,9 @@ export default {
},
submit:{
name: "提交任务后不可更新日志",
req: async function(data){
req: async function(id){
return await http.post(
`${config.API_URL}/pm/mtask/submit/`,
data
`${config.API_URL}/pm/mtask/${id}/submit/`,
);
}
},

View File

@ -261,6 +261,14 @@ export default {
`${config.API_URL}/wpm/handover/gen_by_wm/`,
data);
}
},
submit: {
name: "提交",
req: async function(id){
return await http.post(
`${config.API_URL}/wpm/handover/${id}/submit/`,
);
}
}
},
//车间库存

View File

@ -703,24 +703,60 @@ const routes = [
},
"children": [
{
"name": "mtask",
"path": "/pm/mtask",
"name": "utask_1b",
"path": "/pm/utask",
"meta": {
"title": "生产计划-生产一部",
"title": "生产一部",
"type": "menu",
"icon": "el-icon-cellphone",
"perms": ["pm"]
"perms": ["utask_1b"]
},
"component": "pm/mtask"
// "component": "pm/mtask"
"children": [
{
"name": "utask_dept7",
"path": "/pm/utask_dept7",
"meta": {
"title": "7车间",
"icon": "el-icon-cellphone",
"perms": ["utask_dept7"]
},
"component": "pm/utask_dept7"
},
{
"name": "mtask2",
"path": "/pm/mtask2",
"name": "utask_dept10",
"path": "/pm/utask_dept10",
"meta": {
"title": "生产计划-生产二部",
"title": "10车间",
"icon": "el-icon-cellphone",
"perms": ["inm"]
"perms": ["utask_dept10"]
},
"component": "pm/mtask2"
"component": "pm/utask_dept10"
},
]
},
{
"name": "utask_2b",
"path": "/pm/utask",
"meta": {
"title": "生产二部",
"icon": "el-icon-cellphone",
"type": "menu",
"perms": ["utask_2b"]
},
"children": [
{
"name": "utask_dept6",
"path": "/pm/utask_dept6",
"meta": {
"title": "6车间",
"icon": "el-icon-cellphone",
"perms": ["utask_dept6"]
},
"component": "pm/utask_dept6"
},
]
// "component": "pm/mtask2"
},
// {
// "name": "gantt",
@ -741,19 +777,61 @@ const routes = [
"meta": {
"title": "生产执行",
"icon": "el-icon-grid",
"type": "menu",
"perms": ["wpm"]
"type": "menu"
},
"children": [
{
"name": "worktask",
"path": "/wpm/worktask",
"name": "mlog_1b",
"path": "/wpm/mlog_1b",
"meta": {
"title": "生产一部",
"icon": "el-icon-cellphone",
"perms": ["wpm"]
"type": "menu",
"perms": ["mlog_1b"]
},
"component": "wpm/worktask"
"children": [
{
"name": "mlog_hun",
"path": "/wpm/mlog_hun",
"meta": {
"title": "混料",
"icon": "el-icon-cellphone",
"perms": ["mlog_hun"]
},
"component": "wpm/mlog_hun"
},
{
"name": "mlog_tui",
"path": "/wpm/mlog_tui",
"meta": {
"title": "退火",
"icon": "el-icon-cellphone",
"perms": ["mlog_tui"]
},
"component": "wpm/mlog_tui"
},
{
"name": "mlog_dept7",
"path": "/wpm/mlog_dept7",
"meta": {
"title": "7车间",
"icon": "el-icon-cellphone",
"perms": ["mlog_dept7"]
},
"component": "wpm/mlog_dept7"
},
{
"name": "mlog_dept10",
"path": "/wpm/mlog_dept10",
"meta": {
"title": "10车间",
"icon": "el-icon-cellphone",
"perms": ["mlog_dept10"]
},
"component": "wpm/mlog_dept10"
},
]
// "component": "wpm/worktask"
},
{
"name": "worktaskFlog",
@ -767,14 +845,26 @@ const routes = [
"component": "wpm/worktaskFlog"
},
{
"name": "worktask2",
"path": "/wpm/worktask2",
"name": "mlog_2b",
"path": "/wpm/mlog_2b",
"meta": {
"title": "生产二部",
"icon": "el-icon-cellphone",
"perms": ["wpm"]
},
"component": "wpm/worktask2"
// "component": "wpm/worktask2"
"children": [
{
"name": "mlog_dept6",
"path": "/pm/mlog_dept6",
"meta": {
"title": "6车间",
"icon": "el-icon-cellphone",
"perms": ["mlog_dept6"]
},
"component": "wpm/mlog_dept6"
},
]
},
{
"name": "otherlog",
@ -872,6 +962,46 @@ const routes = [
},
"component": "inm/warehouse"
},
{
"name": "good",
"path": "/inm/good",
"meta": {
"title": "成品库",
"icon": "el-icon-cellphone",
"perms": ["good"]
},
"component": "inm/good"
},
{
"name": "halfgood",
"path": "/inm/halfgood",
"meta": {
"title": "半成品库",
"icon": "el-icon-cellphone",
"perms": ["halfgood"]
},
"component": "inm/halfgood"
},
{
"name": "mainso",
"path": "/inm/mainso",
"meta": {
"title": "原料库",
"icon": "el-icon-cellphone",
"perms": ["mainso"]
},
"component": "inm/mainso"
},
{
"name": "helpso",
"path": "/inm/helpso",
"meta": {
"title": "辅料库",
"icon": "el-icon-cellphone",
"perms": ["helpso"]
},
"component": "inm/helpso"
},
{
"name": "materialbatch",
"path": "/inm/materialbatch",
@ -917,6 +1047,16 @@ const routes = [
"perms": ["pum"]
},
"children": [
{
"name": "supplier",
"path": "/pum/supplier",
"meta": {
"title": "供应商",
"icon": "el-icon-cellphone",
"perms": ["pum"]
},
"component": "pum/supplier"
},
{
"name": "plan",
"path": "/pum/plan",
@ -959,16 +1099,6 @@ const routes = [
},
"component": "pum/orderitem"
},
{
"name": "supplier",
"path": "/pum/supplier",
"meta": {
"title": "供应商",
"icon": "el-icon-cellphone",
"perms": ["pum"]
},
"component": "pum/supplier"
},
]
},
//销售 sam

View File

@ -6,6 +6,11 @@ a:link {text-decoration: none;}
a:-webkit-any-link {text-decoration: none;}
a,button,input,textarea{-webkit-tap-highlight-color:rgba(0,0,0,0);box-sizing: border-box;outline:none !important; -webkit-appearance: none;}
* {margin: 0;padding: 0;box-sizing: border-box;outline: none;}
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
}
/* 大布局样式 */
.aminui {display: flex;flex-flow: column;}

View File

@ -3,9 +3,15 @@
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'equipment.create'">新增</el-button>
<el-select v-model="query.belong_dept" placeholder="所在车间" clearable style="margin-left: 2px;">
<el-option v-for="item in deptOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
<el-select v-model="query.state" placeholder="设备状态" clearable style="margin-left: 2px;">
<el-option v-for="item in stateOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
<div class="right-panel">
<el-input v-model="query.search" placeholder="名称" clearable style="margin-right: 5px;"></el-input>
<el-input v-model="query.search" placeholder="设备名称/编号" clearable style="margin-right: 5px;"></el-input>
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
</div>
</el-header>
@ -40,8 +46,11 @@
</el-tag>
</template>
</el-table-column>
<el-table-column label="技术指标" show-overflow-tooltip>
<template #default="scope">{{ scope.row.parameter }}</template>
<el-table-column label="所在车间" show-overflow-tooltip>
<template #default="scope">{{ scope.row.belong_dept_name }}</template>
</el-table-column>
<el-table-column label="所在工段" show-overflow-tooltip>
<template #default="scope">{{ scope.row.mgroup_name }}</template>
</el-table-column>
<el-table-column label="保管人">
<template #default="scope">{{ scope.row.keeper_name }}</template>
@ -57,14 +66,14 @@
<el-button link type="primary" @click="table_record(scope.row)" v-auth="'echeckrecord.create'">
巡检
</el-button>
<el-divider direction="vertical"></el-divider>
<el-button link type="warning" @click="table_edit(scope.row)" v-auth="'equipment.update'">
编辑
</el-button>
<el-divider direction="vertical"></el-divider>
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'equipment.delete'">
删除
</el-button>
<el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row)" v-auth="'equipment.delete'">
<template #reference>
<el-button link type="danger">删除</el-button>
</template>
</el-popconfirm>
</template>
</el-table-column>
</scTable>
@ -184,6 +193,12 @@ export default {
30: '在修',
40: '禁用',
},
stateOptions: [
{ label: '完好', value: 10 },
{ label: '限用', value: 20 },
{ label: '在修', value: 30 },
{ label: '禁用', value: 40 },
],
results_: {
'pass': '合格',
'fail': '不合格',

138
src/views/inm/good.vue Normal file
View File

@ -0,0 +1,138 @@
<template>
<el-container>
<el-header style="height: 50%; padding: 0;">
<el-container>
<el-header>
<div class="left-panel">
<div style="font-size: 14px">仓库</div>
<el-select v-model="query.warehouse" clearable placeholder="所在仓库" @change="handleQuery"
style="margin-left: 4px">
<el-option v-for="item in warehouseOptions" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
</div>
<div class="right-panel">
<el-input v-model="query.search" placeholder="物料名/批次号" clearable
style="margin-right: 5px;"></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" stripe :params="params">
<el-table-column type="index" width="50" />
<el-table-column label="批次" prop="batch">
</el-table-column>
<el-table-column label="物料名称" prop="material_name">
</el-table-column>
<el-table-column label="规格型号">
<template #default="scope">
<span v-if="scope.row.material_">
{{ scope.row.material_.specification }} {{ scope.row.material_.model }}
</span>
</template>
</el-table-column>
<el-table-column label="已完成工序">
<template #default="scope">
<span v-if="scope.row.material_">
{{ scope.row.material_.process_name }}
</span>
</template>
</el-table-column>
<el-table-column label="仓库" prop="warehouse_name">
</el-table-column>
<el-table-column label="物料存量" prop="count">
</el-table-column>
<el-table-column label="有效期" prop="expiration_date">
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-header>
<el-main class="nopadding">
<el-container>
<el-header>
<div class="left-panel">
<span style="font-size: 14px">车间库存</span>
<!-- <el-select v-model="queryWm.material__process" clearable placeholder="已到工序" @change="handleQueryWm"
style="margin-left: 4px">
<el-option v-for="item in processOptions" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select> -->
</div>
</el-header>
<el-main>
<scTable ref="table_wm" :apiObj="apiObjWm" row-key="id" :params="paramsWm" stripe>
<el-table-column label="批次" prop="batch"> </el-table-column>
<el-table-column label="物料名" prop="material">
<template #default="scope">{{
scope.row.material_.name
}}</template>
</el-table-column>
<el-table-column label="规格" prop="material">
<template #default="scope">{{
scope.row.material_.specification
}}</template>
</el-table-column>
<el-table-column label="型号" prop="material">
<template #default="scope">{{
scope.row.material_.model
}}</template>
</el-table-column>
<el-table-column label="已到工序" prop="material">
<template #default="scope">{{
scope.row.material_.process_name
}}</template>
</el-table-column>
<el-table-column label="所在车间" prop="belong_dept_name">
</el-table-column>
<el-table-column label="数量" prop="count" width="80">
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-main>
</el-container>
</template>
<script>
export default {
name: "halfgood",
data() {
return {
apiObj: this.$API.inm.warehouse.batch,
params: { count__gte: 1, material__type: 10 },
selection: [],
query: {},
warehouseOptions: [],
apiObjWm: this.$API.wpm.wmaterial.list,
paramsWm: { count__gte: 1, material__type: 10 },
// processOptions: [],
queryWm: {}
};
},
mounted() {
this.getWarehouse()
// this.getProcessOptions()
},
methods: {
getWarehouse() {
this.$API.inm.warehouse.list.req({ page: 0 }).then(res => {
this.warehouseOptions = res
})
},
getProcessOptions() {
this.$API.mtm.process.list.req({ page: 0 }).then(res => {
this.processOptions = res
})
},
handleQueryWm() {
this.$refs.table_wm.queryData(this.queryWm)
},
handleQuery() {
this.$refs.table.queryData(this.query)
},
resetQuery() {
this.query = {};
},
},
};
</script>

138
src/views/inm/halfgood.vue Normal file
View File

@ -0,0 +1,138 @@
<template>
<el-container>
<el-header style="height: 50%; padding: 0;">
<el-container>
<el-header>
<div class="left-panel">
<div style="font-size: 14px">仓库</div>
<el-select v-model="query.warehouse" clearable placeholder="所在仓库" @change="handleQuery"
style="margin-left: 4px">
<el-option v-for="item in warehouseOptions" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
</div>
<div class="right-panel">
<el-input v-model="query.search" placeholder="物料名/批次号" clearable
style="margin-right: 5px;"></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" stripe :params="params">
<el-table-column type="index" width="50" />
<el-table-column label="批次" prop="batch">
</el-table-column>
<el-table-column label="物料名称" prop="material_name">
</el-table-column>
<el-table-column label="规格型号">
<template #default="scope">
<span v-if="scope.row.material_">
{{ scope.row.material_.specification }} {{ scope.row.material_.model }}
</span>
</template>
</el-table-column>
<el-table-column label="已完成工序">
<template #default="scope">
<span v-if="scope.row.material_">
{{ scope.row.material_.process_name }}
</span>
</template>
</el-table-column>
<el-table-column label="仓库" prop="warehouse_name">
</el-table-column>
<el-table-column label="物料存量" prop="count">
</el-table-column>
<el-table-column label="有效期" prop="expiration_date">
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-header>
<el-main class="nopadding">
<el-container>
<el-header>
<div class="left-panel">
<span style="font-size: 14px">车间库存</span>
<el-select v-model="queryWm.material__process" clearable placeholder="已到工序" @change="handleQueryWm"
style="margin-left: 4px">
<el-option v-for="item in processOptions" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
</div>
</el-header>
<el-main>
<scTable ref="table_wm" :apiObj="apiObjWm" row-key="id" :params="paramsWm" stripe>
<el-table-column label="批次" prop="batch"> </el-table-column>
<el-table-column label="物料名" prop="material">
<template #default="scope">{{
scope.row.material_.name
}}</template>
</el-table-column>
<el-table-column label="规格" prop="material">
<template #default="scope">{{
scope.row.material_.specification
}}</template>
</el-table-column>
<el-table-column label="型号" prop="material">
<template #default="scope">{{
scope.row.material_.model
}}</template>
</el-table-column>
<el-table-column label="已到工序" prop="material">
<template #default="scope">{{
scope.row.material_.process_name
}}</template>
</el-table-column>
<el-table-column label="所在车间" prop="belong_dept_name">
</el-table-column>
<el-table-column label="数量" prop="count" width="80">
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-main>
</el-container>
</template>
<script>
export default {
name: "halfgood",
data() {
return {
apiObj: this.$API.inm.warehouse.batch,
params: { count__gte: 1, material__type: 20 },
selection: [],
query: {},
warehouseOptions: [],
apiObjWm: this.$API.wpm.wmaterial.list,
paramsWm: { count__gte: 1 },
processOptions: [],
queryWm: {}
};
},
mounted() {
this.getWarehouse()
this.getProcessOptions()
},
methods: {
getWarehouse() {
this.$API.inm.warehouse.list.req({ page: 0 }).then(res => {
this.warehouseOptions = res
})
},
getProcessOptions() {
this.$API.mtm.process.list.req({ page: 0 }).then(res => {
this.processOptions = res
})
},
handleQueryWm() {
this.$refs.table_wm.queryData(this.queryWm)
},
handleQuery() {
this.$refs.table.queryData(this.query)
},
resetQuery() {
this.query = {};
},
},
};
</script>

66
src/views/inm/helpso.vue Normal file
View File

@ -0,0 +1,66 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-select v-model="query.warehouse" clearable placeholder="所在仓库" @change="handleQuery">
<el-option v-for="item in warehouseOptions" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
</div>
<div class="right-panel">
<el-input v-model="query.search" placeholder="物料名" clearable style="margin-right: 5px;"></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" stripe :params="params">
<el-table-column type="index" width="50" />
<el-table-column label="物料批次" prop="batch">
</el-table-column>
<el-table-column label="物料名称" prop="material_name">
</el-table-column>
<el-table-column label="规格型号">
<template #default="scope">
{{ scope.row.specification }} {{ scope.row.model }}
</template>
</el-table-column>
<el-table-column label="仓库" prop="warehouse_name">
</el-table-column>
<el-table-column label="物料存量" prop="count">
</el-table-column>
<el-table-column label="有效期" prop="expiration_date">
</el-table-column>
</scTable>
</el-main>
</el-container>
</template>
<script>
export default {
name: "materials",
data() {
return {
apiObj: this.$API.inm.warehouse.batch,
params: { count__gte: 1, material__type__in: '40' },
selection: [],
query: {},
warehouseOptions: []
};
},
mounted() {
this.getWarehouse()
},
methods: {
getWarehouse() {
this.$API.inm.warehouse.list.req({ page: 0 }).then(res => {
this.warehouseOptions = res
})
},
handleQuery() {
this.$refs.table.queryData(this.query)
},
resetQuery() {
this.query = {};
},
},
};
</script>

66
src/views/inm/mainso.vue Normal file
View File

@ -0,0 +1,66 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-select v-model="query.warehouse" clearable placeholder="所在仓库" @change="handleQuery">
<el-option v-for="item in warehouseOptions" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
</div>
<div class="right-panel">
<el-input v-model="query.search" placeholder="物料名" clearable style="margin-right: 5px;"></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" stripe :params="params">
<el-table-column type="index" width="50" />
<el-table-column label="物料批次" prop="batch">
</el-table-column>
<el-table-column label="物料名称" prop="material_name">
</el-table-column>
<el-table-column label="规格型号">
<template #default="scope">
{{ scope.row.specification }} {{ scope.row.model }}
</template>
</el-table-column>
<el-table-column label="仓库" prop="warehouse_name">
</el-table-column>
<el-table-column label="物料存量" prop="count">
</el-table-column>
<el-table-column label="有效期" prop="expiration_date">
</el-table-column>
</scTable>
</el-main>
</el-container>
</template>
<script>
export default {
name: "materials",
data() {
return {
apiObj: this.$API.inm.warehouse.batch,
params: { count__gte: 1, material__type__in: '30' },
selection: [],
query: {},
warehouseOptions: []
};
},
mounted() {
this.getWarehouse()
},
methods: {
getWarehouse() {
this.$API.inm.warehouse.list.req({ page: 0 }).then(res => {
this.warehouseOptions = res
})
},
handleQuery() {
this.$refs.table.queryData(this.query)
},
resetQuery() {
this.query = {};
},
},
};
</script>

View File

@ -4,6 +4,13 @@
<el-main style="padding: 0 20px 20px 20px">
<el-form ref="dialogForm" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="物料类别" prop="type">
<el-select v-model="form.type" placeholder="物料类别" clearable style="width:100%" @change="typeChange">
<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 :md="12" :sm="24">
<el-form-item label="物料编号" prop="number">
<el-input v-model="form.number" placeholder="物料编号" />
@ -30,16 +37,16 @@
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="物料类别" prop="type">
<el-select v-model="form.type" placeholder="物料类别" clearable style="width:100%" @change="typeChange">
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"></el-option>
<el-form-item label="关联物料" prop="type">
<el-select v-model="brothers" placeholder="关联物料" clearable multiple style="width:100%">
<el-option v-for="item in materialOptions" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="关联物料" prop="type">
<el-select v-model="brothers" placeholder="关联物料" clearable multiple style="width:100%">
<el-option v-for="item in materialOptions" :key="item.id" :label="item.name" :value="item.id" />
<el-form-item label="已到工序" prop="process">
<el-select v-model="form.process" placeholder="已到工序" clearable style="width:100%">
<el-option v-for="item in processOptions" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
@ -53,23 +60,11 @@
<el-input-number v-model="form.count_safe" :min="0" />
</el-form-item>
</el-col>
<!-- <el-col :md="12" :sm="24">
<el-form-item label="计量单位" prop="unit">
<el-select
v-model="form.unit"
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-col :md="12" :sm="24">
<el-form-item label="组合件" prop="is_assemb">
<el-switch v-model="form.is_assemb" />
</el-form-item>
</el-col> -->
</el-col>
</el-row>
</el-form>
</el-main>
@ -114,12 +109,18 @@ export default {
selectionFilters: [],
materialOptions: [],
setFiltersVisible: false,
processOptions: [],
};
},
mounted() {
this.getProcessOptions()
},
methods: {
getProcessOptions() {
this.$API.mtm.process.list.req({ page: 0 }).then(res => {
this.processOptions = res
})
},
//
open(mode = "add", type) {
this.mode = mode;

View File

@ -29,7 +29,8 @@
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="table_add" v-auth="'route.create'">新增</el-button>
<el-button type="primary" icon="el-icon-plus" @click="table_add"
v-auth="'route.create'">新增</el-button>
</div>
</el-header>
<el-main class="nopadding">
@ -53,7 +54,7 @@
</template>
</el-table-column>
<el-table-column label="出材率" prop="out_rate" min-width="80"></el-table-column>
<el-table-column label="自动排产" min-width="80">
<el-table-column label="统计工序" min-width="80">
<template #default="scope">
<el-icon v-if="scope.row.is_count_utask" color="green">
<CircleCheckFilled />
@ -87,11 +88,7 @@
</el-form-item>
<el-form-item label="工序" prop="process">
<el-select v-model="form.process" placeholder="工序" clearable style="width: 100%;" :disabled="updateDisable">
<el-option
v-for="item in processOptions"
:key="item.id"
:label="item.name"
:value="item.id">
<el-option v-for="item in processOptions" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-form-item>
@ -108,7 +105,8 @@
<el-select v-model="form.material_in" placeholder="物料" clearable style="width: 100%;">
<el-option v-for="item in materialOptions" :key="item.id" :label="item.name" :value="item.id">
<span style="float: left">{{ item.name }}</span>
<span style="float: right;color: '#E6A23C';font-size: 13px;" v-if="item.is_hidden">{{ item.process_name }}-隐</span>
<span style="float: right;color: '#E6A23C';font-size: 13px;" v-if="item.is_hidden">{{
item.process_name }}-</span>
</el-option>
</el-select>
</el-form-item>
@ -116,7 +114,8 @@
<el-select v-model="form.material_out" placeholder="物料" clearable style="width: 100%;">
<el-option v-for="item in materialOptions" :key="item.id" :label="item.name" :value="item.id">
<span style="float: left">{{ item.name }}</span>
<span style="float: right;color: '#E6A23C';font-size: 13px;" v-if="item.is_hidden">{{ item.process_name }}-隐</span></el-option>
<span style="float: right;color: '#E6A23C';font-size: 13px;" v-if="item.is_hidden">{{
item.process_name }}-</span></el-option>
</el-select>
</el-form-item>
</el-form>

View File

@ -1,18 +1,10 @@
<template>
<el-container style="flex-direction: column">
<el-main
id="topContainer"
class="nopadding"
style="position: relative; margin-bottom: 10px"
>
<el-main id="topContainer" class="nopadding" style="position: relative; margin-bottom: 10px">
<div class="right-panel btnsContainer">
<el-button type="primary" icon="el-icon-plus" @click="add"
>新增任务</el-button
>
<el-button type="primary" icon="el-icon-plus" @click="add">新增任务</el-button>
<!-- <el-button type="primary" @click="utaskDepuse" v-loading="isloading">任务分解</el-button> -->
<el-button type="primary" @click="utaskDepuse" v-loading="isloading"
>任务下达</el-button
>
<el-button type="primary" @click="utaskDepuse" v-loading="isloading">任务下达</el-button>
</div>
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
<!-- <el-tab-pane label="混料工序" name="8车间">
@ -79,24 +71,12 @@
</scTable>
</el-tab-pane> -->
<el-tab-pane label="成型7车间" name="7车间">
<scTable
ref="table7"
:apiObj="apiUtask"
row-key="id"
stripe
:height="topHeight"
:params="paramsUtask7"
@row-click="rowclick"
@selection-change="handleSelectionChange"
>
<scTable ref="table7" :apiObj="apiUtask" row-key="id" stripe :height="topHeight" :params="paramsUtask7"
@row-click="rowclick" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="40" />
<el-table-column type="index" width="40" />
<el-table-column label="任务编号" prop="number" width="120"> </el-table-column>
<el-table-column
label="产品名称"
prop="material_"
show-overflow-tooltip
>
<el-table-column label="产品名称" prop="material_" show-overflow-tooltip>
<template #default="scope">
{{ scope.row.material_.name }}
</template>
@ -141,26 +121,13 @@
<el-link type="primary" @click="table_show(scope.row)">
查看
</el-link>
<el-divider
direction="vertical"
v-if="scope.row.state == 10"
></el-divider>
<el-link
type="primary"
@click="table_edit(scope.row)"
v-if="scope.row.state == 10"
>
<el-divider direction="vertical" v-if="scope.row.state == 10"></el-divider>
<el-link type="primary" @click="table_edit(scope.row)" v-if="scope.row.state == 10">
编辑
</el-link>
<el-divider
direction="vertical"
v-if="scope.row.state == 10 || scope.row.state == 14"
></el-divider>
<el-link
type="danger"
@click="table_del(scope.row)"
v-if="scope.row.state == 10 || scope.row.state == 14"
>
<el-divider direction="vertical" v-if="scope.row.state == 10 || scope.row.state == 14"></el-divider>
<el-link type="danger" @click="table_del(scope.row)"
v-if="scope.row.state == 10 || scope.row.state == 14">
删除
</el-link>
</template>
@ -168,24 +135,12 @@
</scTable>
</el-tab-pane>
<el-tab-pane label="成型10车间" name="10车间">
<scTable
ref="table10"
:apiObj="apiUtask"
row-key="id"
stripe
:height="topHeight"
:params="paramsUtask10"
@row-click="rowclick"
@selection-change="handleSelectionChange"
>
<scTable ref="table10" :apiObj="apiUtask" row-key="id" stripe :height="topHeight" :params="paramsUtask10"
@row-click="rowclick" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="40" />
<el-table-column type="index" width="40" />
<el-table-column label="任务编号" prop="number" width="120"> </el-table-column>
<el-table-column
label="产品名称"
prop="material"
show-overflow-tooltip
>
<el-table-column label="产品名称" prop="material" show-overflow-tooltip>
<template #default="scope">
{{ scope.row.material_.name }}
</template>
@ -229,36 +184,16 @@
<el-link type="primary" @click="table_show(scope.row)">
查看
</el-link>
<el-divider
direction="vertical"
v-if="scope.row.state == 10"
></el-divider>
<el-link
type="primary"
@click="table_edit(scope.row)"
v-if="scope.row.state == 10"
>
<el-divider direction="vertical" v-if="scope.row.state == 10"></el-divider>
<el-link type="primary" @click="table_edit(scope.row)" v-if="scope.row.state == 10">
编辑
</el-link>
<el-divider
direction="vertical"
v-if="scope.row.state == 30 || scope.row.state == 20"
></el-divider>
<el-link
type="danger"
@click="table_end(scope.row)"
v-if="scope.row.state == 30 || scope.row.state == 20"
>终止</el-link
>
<el-divider
direction="vertical"
v-if="scope.row.state == 10 || scope.row.state == 14"
></el-divider>
<el-link
type="danger"
@click="table_del(scope.row)"
v-if="scope.row.state == 10 || scope.row.state == 14"
>
<el-divider direction="vertical" v-if="scope.row.state == 30 || scope.row.state == 20"></el-divider>
<el-link type="danger" @click="table_end(scope.row)"
v-if="scope.row.state == 30 || scope.row.state == 20">终止</el-link>
<el-divider direction="vertical" v-if="scope.row.state == 10 || scope.row.state == 14"></el-divider>
<el-link type="danger" @click="table_del(scope.row)"
v-if="scope.row.state == 10 || scope.row.state == 14">
删除
</el-link>
</template>
@ -273,53 +208,21 @@
<span style="font-size: 14px">生产进度</span>
</div>
<div class="right-panel">
<el-date-picker
v-model="query.date"
type="daterange"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
value-format="YYYY-MM-DD"
/>
<el-button type="primary" icon="el-icon-search" @click="handleQuery"
>查询</el-button
>
<el-date-picker v-model="query.date" type="daterange" range-separator="" start-placeholder="开始时间"
end-placeholder="结束时间" value-format="YYYY-MM-DD" />
<el-button type="primary" icon="el-icon-search" @click="handleQuery">查询</el-button>
</div>
</el-header>
<scTable
ref="table2"
:data="dataList"
row-key="id"
stripe
:height="bottomHeight"
:hideDo="hideDo"
:params="query"
>
<scTable ref="table2" :data="dataList" row-key="id" stripe :height="bottomHeight" :hideDo="hideDo" :params="query">
<el-table-column type="index" width="50" />
<el-table-column
label="任务编号"
prop="number"
width="100"
fixed="left"
>
<el-table-column label="任务编号" prop="number" width="100" fixed="left">
</el-table-column>
<el-table-column
label="产品名称"
prop="material"
width="100"
show-overflow-tooltip
fixed="left"
>
<el-table-column label="产品名称" prop="material" width="100" show-overflow-tooltip fixed="left">
<template #default="scope">
{{ scope.row.material_.name }}
</template>
</el-table-column>
<el-table-column
label="规格"
prop="specification"
width="100"
fixed="left"
>
<el-table-column label="规格" prop="specification" width="100" fixed="left">
<template #default="scope">
{{ scope.row.material_.specification }}
</template>
@ -352,12 +255,7 @@
fixed="left"
>
</el-table-column> -->
<el-table-column
v-for="item in columList"
:label="item.data"
:key="item"
width="100"
>
<el-table-column v-for="item in columList" :label="item.data" :key="item" width="100">
<div :class="bindClass(item)">
<div v-if="activeName == '10车间'">{{ item.count1 }}</div>
<div>{{ item.count2 }}</div>
@ -367,46 +265,20 @@
</scTable>
</el-main>
</el-container>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
:activeName="activeName"
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
<el-drawer
title="任务详情"
v-model="visibleRecord"
:size="800"
destroy-on-close
@closed="visibleRecord = false"
>
<save-dialog v-if="dialog.save" ref="saveDialog" :activeName="activeName" @success="handleSaveSuccess"
@closed="dialog.save = false"></save-dialog>
<el-drawer title="任务详情" v-model="visibleRecord" :size="800" destroy-on-close @closed="visibleRecord = false">
<el-container v-loading="isloading">
<el-header>
<div class="left-panel">
<el-date-picker
placeholder="工作日期"
v-model="paramsObj.start_date"
type="date"
value-format="YYYY-MM-DD"
@change="handleMtaskQuery"
/>
<el-date-picker placeholder="工作日期" v-model="paramsObj.start_date" type="date" value-format="YYYY-MM-DD"
@change="handleMtaskQuery" />
</div>
</el-header>
<el-main>
<scTable
ref="drawer_table"
:apiObj="apiObj"
row-key="id"
stripe
:params="paramsObj"
>
<scTable ref="drawer_table" :apiObj="apiObj" row-key="id" stripe :params="paramsObj">
<el-table-column type="index" width="50" />
<el-table-column
label="工段"
prop="mgroup_name"
show-overflow-tooltip
>
<el-table-column label="工段" prop="mgroup_name" show-overflow-tooltip>
</el-table-column>
<el-table-column label="任务编号" prop="number"> </el-table-column>
<el-table-column label="数量" prop="count"> </el-table-column>
@ -428,7 +300,7 @@
</el-drawer>
</template>
<script>
import saveDialog from "./mtask_form.vue";
import saveDialog from "./utask_form.vue";
export default {
name: "rparty",
components: {

View File

@ -113,7 +113,8 @@
<el-container v-loading="loading">
<el-header>
<div class="left-panel">
<el-date-picker placeholder="工作日期" v-model="paramsObj.start_date" type="date" value-format="YYYY-MM-DD" @change="handleMtaskQuery"/>
<el-date-picker placeholder="工作日期" v-model="paramsObj.start_date" type="date" value-format="YYYY-MM-DD"
@change="handleMtaskQuery" />
</div>
</el-header>
<el-main>
@ -144,7 +145,7 @@
</template>
<script>
import GanttComponent from '@/components/GanttComponent.vue';
import saveDialog from "./mtask_form.vue";
import saveDialog from "./utask_form.vue";
import { useTransitionFallthroughEmits } from 'element-plus';
export default {
name: "rparty",

View File

@ -0,0 +1,68 @@
<template>
<el-drawer v-model="visible" title="任务详情" :size="800" destroy-on-close @closed="$emit('closed')">
<el-container>
<el-header>
<div class="left-panel">
<el-date-picker placeholder="工作日期" v-model="paramsObj.start_date" type="date" value-format="YYYY-MM-DD"
@change="handleMtaskQuery" />
</div>
</el-header>
<el-main>
<scTable ref="drawer_table" :apiObj="apiObj" row-key="id" stripe :params="paramsObj">
<el-table-column type="index" width="50" />
<el-table-column label="工段" prop="mgroup_name" show-overflow-tooltip>
</el-table-column>
<el-table-column label="任务编号" prop="number"> </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="state" show-overflow-tooltip>
<template #default="scope">
<el-tag v-if="scope.row.state !== 40">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else type="success">
{{ state_[scope.row.state] }}
</el-tag>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-drawer>
</template>
<script>
export default {
emits: ["closed"],
props: {
utaskId: { type: String, default: '' },
},
data() {
return {
visible: false,
apiObj: null,
paramsObj: {},
state_: {
10: "创建中",
14: "已分解",
20: "已下达",
30: "生产中",
40: "已提交",
},
}
},
mounted() {
},
methods: {
handleMtaskQuery() {
this.$refs.drawer_table.queryData(this.paramsObj)
},
open() {
this.visible = true;
this.paramsObj.utask = this.utaskId;
this.apiObj = this.$API.pm.mtask.list;
return this;
},
}
}
</script>

View File

@ -1,185 +0,0 @@
<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-width="120px">
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="任务编号" prop="number">
<el-input v-model="form.number" placeholder="任务编号" :disabled="mode == 'edit'" />
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" v-if="activeName !== '6车间'">
<el-form-item label="工段" prop="mgroup">
<el-select v-model="form.mgroup" placeholder="工段" clearable style="width:100%" :disabled="mode == 'edit'"
@change="getMaterial">
<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 :md="12" :sm="24">
<el-form-item label="产物" prop="material">
<el-select v-model="form.material" placeholder="产物" clearable style="width:100%"
:disabled="mode == 'edit'">
<el-option v-for="item in materialOptions" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="任务数" prop="count">
<el-input-number style="width:100%" v-model="form.count" :min="1" controls-position="right"
placeholder="任务数" />
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="开工日期" prop="start_date">
<el-date-picker v-model="form.start_date" type="date" placeholder="开工日期" value-format="YYYY-MM-DD"
style="width:100%">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="完工日期" prop="end_date">
<el-date-picker v-model="form.end_date" type="date" placeholder="完工日期" value-format="YYYY-MM-DD"
style="width:100%">
</el-date-picker>
</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>
export default {
emits: ["success", "closed"],
props: {
activeName: { type: String, default: '' },
},
data() {
return {
loading: false,
mode: "add",
titleMap: {
add: "新增任务",
edit: "编辑任务",
show: "查看任务",
},
form: {},
rules: {
mgroup: [{ required: true, message: '请选择工段', trigger: "blur" }],
count: [{ required: true, message: '请输入任务数', trigger: "blur" }],
start_date: [{ required: true, message: "请选择开始时间", trigger: "blur" }],
end_date: [{ required: true, message: "请选择结束时间", trigger: "blur" }],
number: [{ required: true, message: "请输入任务编号", trigger: "blur" }],
material: [{ required: true, message: "请选选择产品", trigger: "blur" }]
},
visible: false,
isSaveing: false,
options: [],
materialOptions: [],
selectionFilters: [],
setFiltersVisible: false,
belong_dept_options: [],
group: [],
};
},
mounted() {
this.getMgroup();
if (this.activeName == '6车间') {
this.getMaterial6dept();
}
},
methods: {
//
open(mode = "add", type) {
this.mode = mode;
this.visible = true;
return this;
},
getMgroup() {
var res = this.$API.mtm.mgroup.list.req({ page: 0, belong_dept__name: this.activeName }).then(res => {
this.options = res;
});
},
getMaterial6dept() {
this.$API.mtm.material.list.req({ page: 0, need_route: true }).then(res => {
this.materialOptions = res;
})
},
getMaterial(mgroupId) {
//type:20,is_hidden:false
// page:0,type:'10'
this.$API.mtm.route.list.req({ page: 0, mgroup: mgroupId }).then(res => {
let mOptions = []
for (var i = 0; i < res.length; i++) {
mOptions.push({ 'id': res[i].material_out, 'name': res[i].material_out_name })
}
this.materialOptions = mOptions;
})
// let obj = {};
// obj.page = 0;
// if (this.activeName == '6') {
// obj.type = 10;
// obj.is_hidden = false;
// obj.is_assemb = false;
// } else {
// obj.type = 20;
// obj.is_hidden = false;
// }
// this.$API.mtm.material.list.req(obj).then(res => {
// this.materialOptions = res;
// })
},
//
submit() {
this.$refs.dialogForm.validate(async (valid) => {
if (valid) {
this.isSaveing = true;
try {
var res;
if (this.activeName == '6车间') {
this.form.belong_dept = '3423857962907983872';//6
} else if (this.activeName == '7车间') {
this.form.belong_dept = '3423858259797598208';//7
} else if (this.activeName == '8车间') {
this.form.belong_dept = '3423858687901908992';//8
} else if (this.activeName == '10车间') {
this.form.belong_dept = '3423858348557549568';//10
}
if (this.mode == "add") {
res = await this.$API.pm.utask.create.req(this.form);
} else if (this.mode == "edit") {
res = await this.$API.pm.utask.update.req(this.form.id, this.form);
}
this.isSaveing = false;
this.$emit("success");
this.visible = false;
this.$message.success("操作成功");
} catch (err) {
//
this.isSaveing = false;
return err;
}
}
});
},
//
setData(data) {
Object.assign(this.form, data);
},
//
setFilters(filters) {
this.selectionFilters = filters;
this.setFiltersVisible = true;
},
},
};
</script>
<style></style>

View File

@ -0,0 +1,306 @@
<template>
<el-container>
<el-header style="height: 50%;padding: 0">
<el-container>
<el-header>
<div class="'left-panel'">
<el-button type="primary" icon="el-icon-plus" @click="utaskCreate"
v-auth="'utask.create'">新增任务</el-button>
<el-button type="primary" @click="utaskDepuse" v-loading="isLoading"
v-auth="'utask.assgin'">任务分解并下达</el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table" :apiObj="apiUtask" row-key="id" stripe :params="paramsUtask" @row-click="rowclick"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="40" />
<el-table-column type="index" width="40" />
<el-table-column label="任务编号" prop="number" width="120"> </el-table-column>
<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="material_">
<template #default="scope">
{{ scope.row.material_.specification }}
</template>
</el-table-column>
<el-table-column label="型号" prop="material_">
<template #default="scope">
{{ scope.row.material_.model }}
</template>
</el-table-column>
<el-table-column label="任务状态" prop="state">
<template #default="scope">
<el-tag v-if="scope.row.state !== 40">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else type="success">
{{ state_[scope.row.state] }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="任务量" prop="count"> </el-table-column>
<el-table-column label="计划量" prop="count"> </el-table-column>
<el-table-column label="日均产量" prop="count_day">
</el-table-column>
<el-table-column label="计划开工时间" prop="start_date" width="120">
</el-table-column>
<el-table-column label="计划完工时间" prop="end_date" width="120">
</el-table-column>
<el-table-column label="合格数" prop="count_ok"> </el-table-column>
<el-table-column label="完成率" prop="count">
<template #default="scope">
<span v-if="scope.row.count != 0">{{ (scope.row.count_ok / scope.row.count) * 100 }}</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template #default="scope">
<el-button link type="primary" @click.stop="table_show(scope.row)">
查看
</el-button>
<el-button link type="primary" @click.stop="table_edit(scope.row)"
v-if="scope.row.state == 10">
编辑
</el-button>
<el-popconfirm title="确定删除吗?" @confirm.stop="table_del(scope.row)"
v-if="scope.row.state == 10 || scope.row.state == 14">
<template #reference>
<el-button link type="danger">删除</el-button>
</template>
</el-popconfirm>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-header>
<el-main class="nopadding">
<el-container>
<el-header>
<div class="left-panel">
<span style="font-size: 14px">生产进度</span>
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table2" :data="utaskList" row-key="id" stripe hideDo hidePagination :params="query">
<el-table-column type="index" width="50" />
<el-table-column label="任务编号" prop="number" width="100" fixed="left">
</el-table-column>
<el-table-column label="产品名称" prop="material" width="100" show-overflow-tooltip fixed="left">
<template #default="scope">
{{ scope.row.material_.name }}
</template>
</el-table-column>
<el-table-column label="规格" prop="specification" width="100" fixed="left">
<template #default="scope">
{{ scope.row.material_.specification }}
</template>
</el-table-column>
<el-table-column label="型号" prop="model" width="100" fixed="left">
<template #default="scope">
{{ scope.row.material_.model }}
</template>
</el-table-column>
<el-table-column v-for="item in mtaskList" :label="item.start_date" :key="item.id" width="100">
<div :class="bindClass(item)">
<div>{{ item.count_b }}</div>
<div>{{ item.count_y }}</div>
<div>{{ item.count_ok }}</div>
</div>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-main>
</el-container>
<showDrawer ref="showDrawer" v-if="visibleDrawer" :utaskId="utaskId" @closed="visibleDrawer = false">
</showDrawer>
<save-dialog v-if="dialog.save" ref="saveDialog" :activeDept="currentDept.id" @success="handleSaveSuccess"
@closed="dialog.save = false"></save-dialog>
</template>
<script>
import saveDialog from "./utask_form.vue";
import showDrawer from "./mtask_drawer.vue"
export default {
name: 'utask_dept10',
components: {
saveDialog,
showDrawer
},
data() {
return {
utaskId: '',
visibleDrawer: false,
isLoading: false,
selectedIds: [],
dialog: {
save: false,
},
apiUtask: null,
apiObj: null,
visibleRecord: false,
currentDept: { id: 0 },
paramsUtask: {},
paramsObj: {},
utaskList: [],
state_: {
10: "创建中",
14: "已分解",
20: "已下达",
30: "生产中",
40: "已提交",
},
}
},
mounted() {
this.initDept()
},
methods: {
initDept() {
this.$API.system.dept.list.req({ page: 0, name: '10车间' }).then(res => {
if (res.length == 1) {
this.currentDept = res[0]
this.paramsUtask.belong_dept = this.currentDept.id
this.apiUtask = this.$API.pm.utask.list
} else {
this.$message.error("未找到车间");
}
})
},
utaskDepuse() {
let that = this;
if (that.selectedIds.length > 0) {
let ids = that.selectedIds;
that.isLoading = true;
that.$API.pm.utask.scheduemtasks
.req({ ids: ids })
.then((res) => {
that.$API.pm.utask.assgin
.req({ ids: ids })
.then((res) => {
that.$message.success("下达任务成功");
that.isLoading = false;
that.$refs.table.refresh();
})
.catch(() => {
that.isLoading = false;
});
})
.catch(() => {
that.isLoading = false;
});
} else {
this.$message.error("未选择任何任务");
}
},
handleSelectionChange(selection) {
this.selectedIds = [];
selection.forEach((item) => {
this.selectedIds.push(item.id);
});
},
utaskCreate() {
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_del(row) {
this.$API.pm.utask.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
this.$refs.table.refresh();
return res;
})
.catch((err) => {
return err;
});
},
bindClass(item) {
let classInfo = {
countBlock: true,
redColor: false,
greenColor: false,
orangeColor: false,
};
if (item.state != 40) {
classInfo.orangeColor = true;
} else {
if (item.count_ok >= item.count) {
classInfo.greenColor = true;
} else {
classInfo.redColor = true;
}
}
return classInfo;
},
table_show(row) {
this.utaskId = row.id;
this.visibleDrawer = true;
this.$nextTick(() => {
this.$refs.showDrawer.open();
});
},
rowclick(val) {
let utask = val.id;
this.$API.pm.mtask.list.req({ utask: utask, page: 0 }).then((res) => {
let columList = [];
res.forEach((item) => {
let obj = {};
obj.id = item.id
obj.state = item.state;
obj.count_b = 0
obj.count_y = 0
item.mlogs.forEach((item2) => {
if (item2.shift_name.indexOf('白班')) {
obj.count_b = item2.count_ok
}
else if (item2.shift_name.indexOf('夜班')) {
obj.count_y = item2.count_ok
}
})
obj.count_ok = item.count_ok
obj.count = item.count;
obj.start_date = item.start_date;
columList.push(obj);
});
this.mtaskList = columList
this.utaskList = [val]
});
},
handleSaveSuccess(data, mode) {
this.$refs.table.refresh();
},
}
}
</script>
<style scoped>
.countBlock {
width: 80px;
color: #ffffff;
text-align: center;
}
.redColor {
background-color: brown;
}
.greenColor {
background-color: green;
}
.orangeColor {
background-color: orange;
}
</style>

View File

@ -0,0 +1,332 @@
<template>
<el-container>
<el-header style="height: 50%;padding: 0">
<el-container>
<el-header>
<div class="'left-panel'">
<el-button type="primary" icon="el-icon-plus" @click="utaskCreate"
v-auth="'utask.create'">新增任务</el-button>
<el-button type="primary" @click="utaskDepuse" v-loading="isLoading"
v-auth="'utask.assgin'">任务分解</el-button>
<el-button type="primary" @click="utaskAssgin" v-loading="isLoading"
v-auth="'utask.assgin'">任务下达</el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table" :apiObj="apiUtask" row-key="id" stripe :params="paramsUtask" @row-click="rowclick"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="40" />
<el-table-column type="index" width="40" />
<el-table-column label="任务编号" prop="number" width="120"> </el-table-column>
<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="material_">
<template #default="scope">
{{ scope.row.material_.specification }}
</template>
</el-table-column>
<el-table-column label="型号" prop="material_">
<template #default="scope">
{{ scope.row.material_.model }}
</template>
</el-table-column>
<el-table-column label="任务状态" prop="state">
<template #default="scope">
<el-tag v-if="scope.row.state !== 40">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else type="success">
{{ state_[scope.row.state] }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="任务量" prop="count"> </el-table-column>
<el-table-column label="计划量" prop="count"> </el-table-column>
<el-table-column label="日均产量" prop="count_day">
</el-table-column>
<el-table-column label="计划开工时间" prop="start_date" width="120">
</el-table-column>
<el-table-column label="计划完工时间" prop="end_date" width="120">
</el-table-column>
<el-table-column label="合格数" prop="count_ok"> </el-table-column>
<el-table-column label="完成率" prop="count">
<template #default="scope">
<span v-if="scope.row.count != 0">{{ (scope.row.count_ok / scope.row.count) * 100 }}</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template #default="scope">
<el-button link type="primary" @click.stop="table_show(scope.row)">
查看
</el-button>
<el-button link type="primary" @click.stop="table_edit(scope.row)"
v-if="scope.row.state == 10">
编辑
</el-button>
<el-popconfirm title="确定删除吗?" @confirm.stop="table_del(scope.row)"
v-if="scope.row.state == 10 || scope.row.state == 14">
<template #reference>
<el-button link type="danger">删除</el-button>
</template>
</el-popconfirm>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-header>
<el-main class="nopadding">
<el-container>
<el-header>
<div class="left-panel">
<span style="font-size: 14px">生产进度</span>
</div>
</el-header>
<el-main class="nopadding">
<GanttComponent class="left-container" :tasks="tasks" :start_date="start_date" :end_date="end_date">
</GanttComponent>
</el-main>
</el-container>
</el-main>
</el-container>
<save-dialog v-if="dialog.save" ref="saveDialog" :activeDept="currentDept.id" @success="handleSaveSuccess"
@closed="dialog.save = false"></save-dialog>
<showDrawer ref="showDrawer" v-if="visibleDrawer" :utaskId="utaskId" @closed="visibleDrawer = false">
</showDrawer>
</template>
<script>
import GanttComponent from '@/components/GanttComponent.vue';
import saveDialog from "./utask_form_2.vue";
import showDrawer from "./mtask_drawer.vue"
export default {
name: 'utask_dept6',
components: {
saveDialog,
showDrawer,
GanttComponent
},
data() {
return {
utaskId: '',
visibleDrawer: false,
isLoading: false,
selectedIds: [],
dialog: {
save: false,
},
apiUtask: null,
currentDept: { id: 0 },
paramsUtask: {},
utaskList: [],
state_: {
10: "创建中",
14: "已分解",
20: "已下达",
30: "生产中",
40: "已提交",
},
tasks: {
data: []
},
end_date: '',
start_date: '',
}
},
mounted() {
this.initDept()
},
methods: {
initDept() {
this.$API.system.dept.list.req({ page: 0, name: '6车间' }).then(res => {
if (res.length == 1) {
this.currentDept = res[0]
this.paramsUtask.belong_dept = this.currentDept.id
this.apiUtask = this.$API.pm.utask.list
} else {
this.$message.error("未找到车间");
}
})
},
utaskDepuse() {
let that = this;
if (that.selectedIds.length > 0) {
let ids = that.selectedIds;
that.isLoading = true;
that.$API.pm.utask.scheduemtasks
.req({ ids: ids })
.then((res) => {
that.$message.success("分解任务成功");
that.isLoading = false;
that.$refs.table.refresh();
})
.catch(() => {
that.isLoading = false;
});
} else {
this.$message.error("未选择任何任务");
}
},
utaskAssgin() {
let that = this;
if (that.selectedIds.length > 0) {
let ids = that.selectedIds;
that.isLoading = true;
that.$API.pm.utask.assgin
.req({ ids: ids })
.then((res) => {
that.$message.success("下达任务成功");
that.isLoading = false;
that.$refs.table.refresh();
})
.catch(() => {
that.isLoading = false;
});
} else {
this.$message.error("未选择任何任务");
}
},
handleSelectionChange(selection) {
this.selectedIds = [];
selection.forEach((item) => {
this.selectedIds.push(item.id);
});
},
utaskCreate() {
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_del(row) {
this.$API.pm.utask.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
this.$refs.table.refresh();
return res;
})
.catch((err) => {
return err;
});
},
bindClass(item) {
let classInfo = {
countBlock: true,
redColor: false,
greenColor: false,
orangeColor: false,
};
if (item.state != 40) {
classInfo.orangeColor = true;
} else {
if (item.count_ok >= item.count) {
classInfo.greenColor = true;
} else {
classInfo.redColor = true;
}
}
return classInfo;
},
table_show(row) {
this.utaskId = row.id;
this.visibleDrawer = true;
this.$nextTick(() => {
this.$refs.showDrawer.open();
});
},
rowclick(row) {
// mtask
let that = this;
let data = [];
let start_date = row.start_date;
let end_date = row.end_date;
let objItem = {};
objItem.id = row.id;
objItem.type = 'utask';
objItem.number = row.number;
objItem.count = row.count;
objItem.text = row.number;
objItem.material_name = row.material_.name;
objItem.material_specification = row.material_.specification;
objItem.material_model = row.material_.model;
objItem.progress = 1;
objItem.count_ok = row.count_ok;
objItem.count_real = row.count_real;
objItem.count_notok = row.count_notok;
objItem.state = row.state;
objItem.start_date = row.start_date;
objItem.mgroup_name = row.mgroup_name;
objItem.open = true;
data.push(objItem)
this.$API.pm.mtask.list.req({ utask: row.id, page: 0, ordering: 'start_date,mgroup__process__sort' }).then(res => {
res.forEach(item => {
let obj = {};
obj.id = item.id;
obj.type = 'task';
obj.parent = row.id;
obj.number = item.number;
obj.text = item.mgroup_name;
obj.state = item.state;
obj.start = item.start_date;
obj.start_date = item.start_date;
obj.duration = 1;
obj.progress = item.count_real / item.count;
obj.count = item.count;
obj.count_ok = item.count_ok;
obj.count_real = item.count_real;
obj.count_notok = item.count_notok;
obj.state = item.state;
obj.utask = item.utask;
obj.mgroup_name = item.mgroup_name;
// obj.material_name = item.material_out_.name;
// obj.material_specification = item.material_out_.specification;
data.push(obj)
})
// console.log(that.tasks.data)
// console.log('tasks:',that.tasks)
// :gantt
that.start_date = start_date
that.end_date = end_date
that.tasks.data = data
gantt.parse(that.tasks);
//
gantt.refreshData();
})
},
handleSaveSuccess(data, mode) {
this.$refs.table.refresh();
},
}
}
</script>
<style scoped>
.countBlock {
width: 80px;
color: #ffffff;
text-align: center;
}
.redColor {
background-color: brown;
}
.greenColor {
background-color: green;
}
.orangeColor {
background-color: orange;
}
</style>

View File

@ -0,0 +1,296 @@
<template>
<el-container>
<el-header style="height: 50%;padding: 0">
<el-container>
<el-header>
<div class="'left-panel'">
<el-button type="primary" icon="el-icon-plus" @click="utaskCreate"
v-auth="'utask.create'">新增任务</el-button>
<el-button type="primary" @click="utaskDepuse" v-loading="isLoading"
v-auth="'utask.assgin'">任务分解并下达</el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table" :apiObj="apiUtask" row-key="id" stripe :params="paramsUtask" @row-click="rowclick"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="40" />
<el-table-column type="index" width="40" />
<el-table-column label="任务编号" prop="number" width="120"> </el-table-column>
<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="material_">
<template #default="scope">
{{ scope.row.material_.specification }}
</template>
</el-table-column>
<el-table-column label="型号" prop="material_">
<template #default="scope">
{{ scope.row.material_.model }}
</template>
</el-table-column>
<el-table-column label="任务状态" prop="state">
<template #default="scope">
<el-tag v-if="scope.row.state !== 40">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else type="success">
{{ state_[scope.row.state] }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="任务量" prop="count"> </el-table-column>
<el-table-column label="计划量" prop="count"> </el-table-column>
<el-table-column label="日均产量" prop="count_day">
</el-table-column>
<el-table-column label="计划开工时间" prop="start_date" width="120">
</el-table-column>
<el-table-column label="计划完工时间" prop="end_date" width="120">
</el-table-column>
<el-table-column label="合格数" prop="count_ok"> </el-table-column>
<el-table-column label="完成率" prop="count">
<template #default="scope">
<span v-if="scope.row.count != 0">{{ (scope.row.count_ok / scope.row.count) * 100 }}</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template #default="scope">
<el-button link type="primary" @click.stop="table_show(scope.row)">
查看
</el-button>
<el-button link type="primary" @click.stop="table_edit(scope.row)"
v-if="scope.row.state == 10">
编辑
</el-button>
<el-popconfirm title="确定删除吗?" @confirm.stop="table_del(scope.row)"
v-if="scope.row.state == 10 || scope.row.state == 14">
<template #reference>
<el-button link type="danger">删除</el-button>
</template>
</el-popconfirm>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-header>
<el-main class="nopadding">
<el-container>
<el-header>
<div class="left-panel">
<span style="font-size: 14px">生产进度</span>
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table2" :data="utaskList" row-key="id" stripe hideDo hidePagination :params="query">
<el-table-column type="index" width="50" />
<el-table-column label="任务编号" prop="number" width="100" fixed="left">
</el-table-column>
<el-table-column label="产品名称" prop="material" width="100" show-overflow-tooltip fixed="left">
<template #default="scope">
{{ scope.row.material_.name }}
</template>
</el-table-column>
<el-table-column label="规格" prop="specification" width="100" fixed="left">
<template #default="scope">
{{ scope.row.material_.specification }}
</template>
</el-table-column>
<el-table-column label="型号" prop="model" width="100" fixed="left">
<template #default="scope">
{{ scope.row.material_.model }}
</template>
</el-table-column>
<el-table-column v-for="item in mtaskList" :label="item.start_date" :key="item.id" width="100">
<div :class="bindClass(item)">
<div>{{ item.count_ok }}</div>
<div>{{ item.rate }}</div>
</div>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-main>
</el-container>
<showDrawer ref="showDrawer" v-if="visibleDrawer" :utaskId="utaskId" @closed="visibleDrawer = false">
</showDrawer>
<save-dialog v-if="dialog.save" ref="saveDialog" :activeDept="currentDept.id" @success="handleSaveSuccess"
@closed="dialog.save = false"></save-dialog>
</template>
<script>
import saveDialog from "./utask_form.vue";
import showDrawer from "./mtask_drawer.vue"
export default {
name: 'utask_dept7',
components: {
saveDialog,
showDrawer
},
data() {
return {
utaskId: '',
visibleDrawer: false,
isLoading: false,
selectedIds: [],
dialog: {
save: false,
},
apiUtask: null,
apiObj: null,
visibleRecord: false,
currentDept: { id: 0 },
paramsUtask: {},
paramsObj: {},
utaskList: [],
state_: {
10: "创建中",
14: "已分解",
20: "已下达",
30: "生产中",
40: "已提交",
},
}
},
mounted() {
this.initDept()
},
methods: {
initDept() {
this.$API.system.dept.list.req({ page: 0, name: '7车间' }).then(res => {
if (res.length == 1) {
this.currentDept = res[0]
this.paramsUtask.belong_dept = this.currentDept.id
this.apiUtask = this.$API.pm.utask.list
} else {
this.$message.error("未找到车间");
}
})
},
utaskDepuse() {
let that = this;
if (that.selectedIds.length > 0) {
let ids = that.selectedIds;
that.isLoading = true;
that.$API.pm.utask.scheduemtasks
.req({ ids: ids })
.then((res) => {
that.$API.pm.utask.assgin
.req({ ids: ids })
.then((res) => {
that.$message.success("下达任务成功");
that.isLoading = false;
that.$refs.table.refresh();
})
.catch(() => {
that.isLoading = false;
});
})
.catch(() => {
that.isLoading = false;
});
} else {
this.$message.error("未选择任何任务");
}
},
handleSelectionChange(selection) {
this.selectedIds = [];
selection.forEach((item) => {
this.selectedIds.push(item.id);
});
},
utaskCreate() {
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_del(row) {
this.$API.pm.utask.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
this.$refs.table.refresh();
return res;
})
.catch((err) => {
return err;
});
},
bindClass(item) {
let classInfo = {
countBlock: true,
redColor: false,
greenColor: false,
orangeColor: false,
};
if (item.state != 40) {
classInfo.orangeColor = true;
} else {
if (item.count_ok >= item.count) {
classInfo.greenColor = true;
} else {
classInfo.redColor = true;
}
}
return classInfo;
},
table_show(row) {
this.utaskId = row.id;
this.visibleDrawer = true;
this.$nextTick(() => {
this.$refs.showDrawer.open();
});
},
rowclick(val) {
let utask = val.id;
this.$API.pm.mtask.list.req({ utask: utask, page: 0 }).then((res) => {
let columList = [];
res.forEach((item) => {
let obj = {};
obj.id = item.id
obj.state = item.state;
obj.count_ok = item.count_ok
obj.count = item.count;
obj.start_date = item.start_date;
obj.rate = ((item.count_ok / item.count) * 100).toFixed(0) + '%';
columList.push(obj);
});
this.mtaskList = columList
this.utaskList = [val]
});
},
handleSaveSuccess(data, mode) {
this.$refs.table.refresh();
},
}
}
</script>
<style scoped>
.countBlock {
width: 80px;
color: #ffffff;
text-align: center;
}
.redColor {
background-color: brown;
}
.greenColor {
background-color: green;
}
.orangeColor {
background-color: orange;
}
</style>

137
src/views/pm/utask_form.vue Normal file
View File

@ -0,0 +1,137 @@
<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-width="120px">
<el-form-item label="任务编号" prop="number">
<el-input v-model="form.number" placeholder="任务编号" :disabled="mode == 'edit'" />
</el-form-item>
<el-form-item label="生产路线" prop="route" v-if="mode == 'add'">
<el-select placeholder="路线" v-model="currentRoute" value-key="id" style="width:100%" @change="routeChange">
<el-option v-for="item in routeOptions" :key="item.id" :label="item.label" :value="item">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="生产路线" prop="route" v-if="mode == 'edit'">
<span>{{ form.mgroup_name }}---<span v-if="form.material_">{{ form.material_.name }}</span></span>
</el-form-item>
<el-form-item label="任务数" prop="count">
<el-input-number style="width:100%" v-model="form.count" :min="1" controls-position="right"
placeholder="任务数" />
</el-form-item>
<el-form-item label="开工日期" prop="start_date">
<el-date-picker v-model="form.start_date" type="date" placeholder="开工日期" value-format="YYYY-MM-DD"
style="width:100%">
</el-date-picker>
</el-form-item>
<el-form-item label="完工日期" prop="end_date">
<el-date-picker v-model="form.end_date" type="date" placeholder="完工日期" value-format="YYYY-MM-DD"
style="width:100%">
</el-date-picker>
</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>
export default {
emits: ["success", "closed"],
props: {
activeDept: { type: String, default: '' },
},
data() {
return {
loading: false,
mode: "add",
titleMap: {
add: "新增任务",
edit: "编辑任务",
show: "查看任务",
},
routeOptions: [],
currentRoute: '',
form: {},
rules: {
count: [{ required: true, message: '请输入任务数', trigger: "blur" }],
start_date: [{ required: true, message: "请选择开始时间", trigger: "blur" }],
end_date: [{ required: true, message: "请选择结束时间", trigger: "blur" }],
number: [{ required: true, message: "请输入任务编号", trigger: "blur" }],
},
visible: false,
isSaveing: false,
options: [],
materialOptions: [],
selectionFilters: [],
setFiltersVisible: false,
belong_dept_options: [],
group: [],
};
},
mounted() {
this.getRouteOptions();
},
methods: {
getRouteOptions() {
this.$API.mtm.route.list.req({ page: 0, mgroup__belong_dept: this.activeDept }).then(res => {
for (var i = 0; i < res.length; i++) {
if (res[i].material_in_name == undefined) {
res[i].material_in_name = ''
}
res[i].label = res[i].material_in_name + '->' + res[i].material_out_name
}
this.routeOptions = res
})
},
routeChange(item) {
this.form.material = item.material_out
this.form.material_in = item.material_in
this.form.mgroup = item.mgroup
},
//
open(mode = "add", type) {
this.mode = mode;
this.visible = true;
return this;
},
//
submit() {
this.$refs.dialogForm.validate(async (valid) => {
if (valid) {
this.isSaveing = true;
try {
var res;
if (this.mode == "add") {
res = await this.$API.pm.utask.create.req(this.form);
} else if (this.mode == "edit") {
res = await this.$API.pm.utask.update.req(this.form.id, this.form);
}
this.isSaveing = false;
this.$emit("success");
this.visible = false;
this.$message.success("操作成功");
} catch (err) {
//
this.isSaveing = false;
return err;
}
}
});
},
//
setData(data) {
Object.assign(this.form, data);
},
//
setFilters(filters) {
this.selectionFilters = filters;
this.setFiltersVisible = true;
},
},
};
</script>
<style></style>

View File

@ -0,0 +1,118 @@
<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-width="120px">
<el-form-item label="任务编号" prop="number">
<el-input v-model="form.number" placeholder="任务编号" :disabled="mode == 'edit'" />
</el-form-item>
<el-form-item label="产物" prop="material" v-if="mode == 'add'">
<el-select placeholder="产物" v-model="form.material" style="width:100%">
<el-option v-for="item in materialOptions" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="产物" prop="material" v-if="mode == 'edit'">
<span v-if="form.material_">{{ form.material_.name }}</span>
</el-form-item>
<el-form-item label="任务数" prop="count">
<el-input-number style="width:100%" v-model="form.count" :min="1" controls-position="right"
placeholder="任务数" />
</el-form-item>
<el-form-item label="开工日期" prop="start_date">
<el-date-picker v-model="form.start_date" type="date" placeholder="开工日期" value-format="YYYY-MM-DD"
style="width:100%">
</el-date-picker>
</el-form-item>
<el-form-item label="完工日期" prop="end_date">
<el-date-picker v-model="form.end_date" type="date" placeholder="完工日期" value-format="YYYY-MM-DD"
style="width:100%">
</el-date-picker>
</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>
export default {
emits: ["success", "closed"],
props: {
activeDept: { type: String, default: '' },
},
data() {
return {
loading: false,
mode: "add",
titleMap: {
add: "新增任务",
edit: "编辑任务",
show: "查看任务",
},
routeOptions: [],
currentRoute: '',
form: {},
rules: {
count: [{ required: true, message: '请输入任务数', trigger: "blur" }],
material: [{ required: true, message: "请选择产物", trigger: "blur" }],
start_date: [{ required: true, message: "请选择开始时间", trigger: "blur" }],
end_date: [{ required: true, message: "请选择结束时间", trigger: "blur" }],
number: [{ required: true, message: "请输入任务编号", trigger: "blur" }],
},
visible: false,
isSaveing: false,
materialOptions: [],
};
},
mounted() {
this.getMaterialOptions();
},
methods: {
getMaterialOptions() {
this.$API.mtm.material.list.req({ page: 0, need_route: true }).then(res => {
this.materialOptions = res
})
},
//
open(mode = "add", type) {
this.mode = mode;
this.visible = true;
return this;
},
//
submit() {
this.$refs.dialogForm.validate(async (valid) => {
if (valid) {
this.isSaveing = true;
try {
var res;
if (this.mode == "add") {
this.form.belong_dept = this.activeDept;
res = await this.$API.pm.utask.create.req(this.form);
} else if (this.mode == "edit") {
res = await this.$API.pm.utask.update.req(this.form.id, this.form);
}
this.isSaveing = false;
this.$emit("success");
this.visible = false;
this.$message.success("操作成功");
} catch (err) {
//
this.isSaveing = false;
return err;
}
}
});
},
//
setData(data) {
Object.assign(this.form, data);
},
},
};
</script>
<style></style>

View File

@ -5,7 +5,7 @@
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'pu_order.create'">新增</el-button>
</div>
<div class="right-panel">
<el-input v-model="query.search" placeholder="名称" clearable style="margin-right: 5px;"></el-input>
<el-input v-model="query.search" placeholder="订单编号" clearable style="margin-right: 5px;"></el-input>
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
</div>
</el-header>
@ -16,32 +16,42 @@
</el-table-column>
<el-table-column label="供应商" prop="supplier_name" show-overflow-tooltip>
</el-table-column>
<el-table-column label="物料信息" prop="materials_">
<template #default="scope">
<div v-for="item in scope.row.materials_" v-bind:key="item.id">
<span>{{ item.name }}[{{ item.specification }}][{{ item.model }}]</span>
</div>
</template>
</el-table-column>
<el-table-column label="截止到货日期" prop="delivery_date">
</el-table-column>
<el-table-column label="状态" prop="state">
<template #default="scope">
<span><el-tag :type="stateOption[scope.row.state].color">{{ stateOption[scope.row.state].label }}</el-tag></span>
<span><el-tag :type="stateOption[scope.row.state].color">{{ stateOption[scope.row.state].label
}}</el-tag></span>
</template>
</el-table-column>
<el-table-column label="提交时间" prop="submit_time">
</el-table-column>
<el-table-column label="创建人" prop="create_by_name">
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="200">
<template #default="scope">
<el-link type="primary" @click="table_detail(scope.row)" v-auth="'pu_order.update'">
<el-button link type="primary" @click="table_detail(scope.row)">
详情
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="primary" @click="table_edit(scope.row)" v-auth="'pu_order.update'">
</el-button>
<el-button link type="primary" @click="table_edit(scope.row)" v-auth="'pu_order.update'"
v-if="scope.row.state == 10">
编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="primary" @click="table_submit(scope.row)" v-auth="'pu_order.update'">
</el-button>
<el-button link type="primary" @click="table_submit(scope.row)" v-auth="'pu_order.submit'"
v-if="scope.row.state == 10">
提交
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="danger" @click="table_del(scope.row)" v-auth="'pu_order.delete'">
</el-button>
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'pu_order.delete'"
v-if="scope.row.state == 10">
删除
</el-link>
</el-button>
</template>
</el-table-column>
</scTable>

View File

@ -1,19 +1,8 @@
<template>
<el-dialog
:title="titleMap[mode]"
v-model="visible"
:size="1000"
destroy-on-close
@closed="$emit('closed')"
>
<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-width="120px"
>
<el-form ref="dialogForm" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="订单编号" prop="number">
@ -22,42 +11,15 @@
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="供应商" prop="supplier">
<el-select
v-model="form.supplier"
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 v-model="form.supplier" 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 :md="12" :sm="24">
<el-form-item label="截止到货日期">
<el-date-picker
v-model="form.delivery_date"
type="date"
placeholder="截止到货日期"
value-format="YYYY-MM-DD"
style="width:100%"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="提交时间">
<el-date-picker
v-model="form.submit_time"
type="datetime"
placeholder="提交时间"
value-format="YYYY-MM-DD HH:mm:ss"
style="width:100%"
>
<el-date-picker v-model="form.delivery_date" type="date" placeholder="截止到货日期" value-format="YYYY-MM-DD"
style="width:100%">
</el-date-picker>
</el-form-item>
</el-col>
@ -144,5 +106,4 @@ export default {
},
};
</script>
<style>
</style>
<style></style>

View File

@ -1,36 +1,27 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-input v-model="query.search" placeholder="名称" clearable style="margin-right: 5px;"></el-input>
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
</div>
<div class="right-panel">
<el-button type="primary" @click="addLinkPlanItem"
v-auth="'pu_orderitem.create'">计划明细变更采购明细</el-button>
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'pu_orderitem.create'">新增</el-button>
</div>
</el-header>
<el-card>
<el-form label-width="120px">
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="订单编号:">{{ orderObj.number }}</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="订单状态:">{{ orderObj.state }}</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="所属部门">{{ orderObj.belong_dept }}</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="交货日期:">{{ orderObj.delivery_date }}</el-form-item>
</el-col>
</el-row>
</el-form>
<div style="padding: 8px">
<div>
<el-card style="width: 100%" header="基本信息" shadow="hover">
<el-descriptions>
<el-descriptions-item label="订单编号">{{ orderObj.number }}</el-descriptions-item>
<el-descriptions-item label="订单状态">{{ stateOption[orderObj.state] }}</el-descriptions-item>
<el-descriptions-item label="供应商">{{ orderObj.supplier_name }}</el-descriptions-item>
<el-descriptions-item label="所属部门">{{ orderObj.belong_dept_name }}</el-descriptions-item>
<el-descriptions-item label="创建人">{{ orderObj.create_by_name }}</el-descriptions-item>
<el-descriptions-item label="创建时间">{{ orderObj.create_time }}</el-descriptions-item>
</el-descriptions>
</el-card>
<el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query" hidePagination>
</div>
<div style="height:8px"></div>
<div>
<el-card style="width: 100%" header="订单明细" shadow="hover">
<div>
<el-button type="primary" @click="addLinkPlanItem" v-auth="'pu_orderitem.create'"
v-if="orderObj.state == 10">计划明细变更采购明细</el-button>
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'pu_orderitem.create'"
v-if="orderObj.state == 10">手动新增</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">
@ -47,18 +38,20 @@
</el-table-column>
<el-table-column label="操作" fixed="right" align="left" width="100px">
<template #default="scope">
<el-link type="primary" @click="table_edit(scope.row)" v-auth="'pu_orderitem.update'">
<el-button link type="primary" @click="table_edit(scope.row)" v-auth="'pu_orderitem.update'"
v-if="orderObj.state == 10">
编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="danger" @click="table_del(scope.row)" v-auth="'pu_orderitem.delete'">
</el-button>
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'pu_orderitem.delete'"
v-if="orderObj.state == 10">
删除
</el-link>
</el-button>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-card>
</div>
</div>
<save-dialog v-if="dialog.save" ref="saveDialog" :puOrder="puOrder" @success="handleSaveSuccess"
@closed="dialog.save = false"></save-dialog>
<plan-dialog v-if="dialog.plan" ref="planDialog" :puOrder="puOrder" @success="handlePlanSuccess"
@ -78,24 +71,24 @@ export default {
save: false,
splan: false,
},
apiObj: this.$API.pum.orderitem.list,
query: {
page: 1,
page_size: 20
},
apiObj: null,
params: {},
query: {},
puOrder: '',
orderObj: {},
selection: [],
state_: {
10: '完好',
20: '限用',
30: '在修',
40: '禁用',
stateOption: {
10: "创建中",
20: "已提交",
30: "到货中",
40: "已完成",
},
};
},
mounted() {
this.puOrder = this.$route.query.pu_order;
this.params.pu_order = this.$route.query.pu_order;
this.apiObj = this.$API.pum.orderitem.list;
this.getOrder();
},
methods: {

View File

@ -63,7 +63,7 @@
</el-container>
</el-container>
<el-footer>
<el-button type="primary" :loading="isSaveing" @click="createOrderItem">生成订单</el-button>
<el-button type="primary" :loading="isSaveing" @click="createOrderItem">加入订单</el-button>
<el-button @click="clearSelect">清空选择</el-button>
</el-footer>
</el-dialog>

View File

@ -5,7 +5,7 @@
<el-button type="primary" icon="el-icon-plus" @click="add">新增</el-button>
</div>
<div class="right-panel">
<el-input v-model="query.search" placeholder="名称" clearable style="margin-right: 5px;"></el-input>
<el-input v-model="query.search" placeholder="计划编号" clearable style="margin-right: 5px;"></el-input>
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
</div>
</el-header>
@ -18,26 +18,25 @@
</el-table-column>
<el-table-column label="状态" prop="state">
<template #default="scope">
<span><el-tag :type="stateOption[scope.row.state].color">{{ stateOption[scope.row.state].label }}</el-tag></span>
<span><el-tag :type="stateOption[scope.row.state].color">{{ stateOption[scope.row.state].label
}}</el-tag></span>
</template>
</el-table-column>
<el-table-column label="提交时间" prop="submit_time" show-overflow-tooltip>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="200">
<template #default="scope">
<el-link type="primary" @click="table_detail(scope.row)">详情
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="primary" @click="table_edit(scope.row)" v-auth="'pu_plan.update'"
:disabled="scope.row.state !== 10">编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="primary" @click="table_submit(scope.row)" v-auth="'pu_plan.update'"
:disabled="scope.row.state !== 10">提交
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="danger" @click="table_del(scope.row)" v-auth="'pu_plan.delete'">删除
</el-link>
<el-button link type="primary" @click="table_detail(scope.row)">详情
</el-button>
<el-button link type="primary" @click="table_edit(scope.row)" v-auth="'pu_plan.update'"
v-if="scope.row.state == 10">编辑
</el-button>
<el-button link type="primary" @click="table_submit(scope.row)" v-auth="'pu_plan.submit'"
v-if="scope.row.state == 10">提交
</el-button>
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'pu_plan.delete'"
v-if="scope.row.state == 10">删除
</el-button>
</template>
</el-table-column>
</scTable>

View File

@ -5,7 +5,7 @@
<el-descriptions>
<el-descriptions-item label="计划名称">{{ orderObj.name }}</el-descriptions-item>
<el-descriptions-item label="计划编号">{{ orderObj.number }}</el-descriptions-item>
<el-descriptions-item label="计划状态">{{ orderObj.state }}</el-descriptions-item>
<el-descriptions-item label="计划状态">{{ stateOption[orderObj.state] }}</el-descriptions-item>
</el-descriptions>
</el-card>
</div>
@ -13,9 +13,10 @@
<div>
<el-card style="width: 100%" header="计划明细" shadow="hover">
<div>
<el-button type="primary" icon="el-icon-plus" v-auth="'pu_planitem.create'" @click="add">新增</el-button>
<el-button type="primary" icon="el-icon-plus" v-auth="'pu_planitem.create'" @click="add"
v-if="orderObj == 10">新增</el-button>
</div>
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query" hidePagination>
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query" hidePagination hideDo>
<el-table-column type="index" width="50" />
<el-table-column label="所属物料" prop="material" show-overflow-tooltip>
<template #default="scope">
@ -29,6 +30,10 @@
<el-table-column label="部门" prop="belong_dept_name">
</el-table-column>
<el-table-column label="关联采购订单" prop="pu_order">
<template #default="scope">
<span v-if="scope.row.pu_order"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="创建人" prop="create_by_name">
</el-table-column>
@ -36,13 +41,14 @@
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="100px">
<template #default="scope">
<el-link type="primary" @click="table_edit(scope.row)" v-auth="'pu_planitem.update'">
<el-button link type="primary" @click="table_edit(scope.row)" v-auth="'pu_planitem.update'"
v-if="orderObj == 10">
编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="danger" @click="table_del(scope.row)" v-auth="'pu_planitem.delete'">
</el-button>
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'pu_planitem.delete'"
v-if="orderObj == 10">
删除
</el-link>
</el-button>
</template>
</el-table-column>
</scTable>
@ -71,6 +77,13 @@ export default {
page: 1,
page_size: 20
},
stateOption: {
10: "创建中",
20: "已提交",
30: "下单中",
40: "下单完成",
40: "已完成",
},
};
},
mounted() {

View File

@ -6,27 +6,12 @@
</div>
<div class="right-panel">
<el-input
v-model="query.search"
placeholder="名称"
clearable
style="margin-right: 5px;"
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
<el-input v-model="query.search" placeholder="名称" clearable style="margin-right: 5px;"></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"
stripe
:params="query"
>
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query">
<el-table-column type="index" width="50" />
<el-table-column label="供应商名称" prop="name" show-overflow-tooltip>
</el-table-column>
@ -38,32 +23,21 @@
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="120px">
<template #default="scope">
<el-link
type="primary"
@click="table_edit(scope.row)"
v-auth="'supplier.update'"
>
<el-button link type="primary" @click="table_edit(scope.row)" v-auth="'supplier.update'">
编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link
type="danger"
@click="table_del(scope.row)"
v-auth="'supplier.delete'"
>
删除
</el-link>
</el-button>
<el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row)" v-auth="'supplier.delete'">
<template #reference>
<el-button link 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>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess"
@closed="dialog.save = false"></save-dialog>
</template>
<script>
import saveDialog from "./supplier_form.vue";
@ -116,10 +90,11 @@
},
//
async table_del(row) {
this.$API.inm.warehouse.delete
this.$API.pum.supplier.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
this.$refs.table.refresh();
return res;
})
.catch((err) => {

View File

@ -5,26 +5,12 @@
<el-button type="primary" icon="el-icon-plus" @click="add">新增</el-button>
</div>
<div class="right-panel">
<el-date-picker
v-model="query.date"
type="date"
value-format="YYYY-MM-DD"
/>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
>查询</el-button>
<el-date-picker v-model="query.date" type="date" value-format="YYYY-MM-DD" />
<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"
stripe
:params="query"
>
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query">
<el-table-column type="index" width="50" />
<el-table-column label="日期" prop="test_date" show-overflow-tooltip>
</el-table-column>
@ -74,23 +60,16 @@
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="100">
<template #default="scope">
<el-link
type="primary"
@click="table_edit(scope.row)"
>编辑
<el-link type="primary" @click="table_edit(scope.row)">编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link
type="primary"
@click="table_del(scope.row)"
>删除
<el-link type="primary" @click="table_del(scope.row)">删除
</el-link>
</template>
</el-table-column>
</scTable>
</el-main>
<check-dialog v-if="dialog.check" ref="checkDialog"
@success="handleCheckSuccess" @closed="dialog.check = false">
<check-dialog v-if="dialog.check" ref="checkDialog" @success="handleCheckSuccess" @closed="dialog.check = false">
</check-dialog>
</el-container>
</template>

View File

@ -34,23 +34,21 @@
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="200">
<template #default="scope">
<el-link type="primary" @click="table_detail(scope.row)" v-auth="'order.update'">
<el-button link type="primary" @click="table_detail(scope.row)">
详情
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="primary" @click="table_submit(scope.row)" v-auth="'order.update'"
:disabled="scope.row.state !== 10">
</el-button>
<el-button link type="primary" @click="table_submit(scope.row)" v-auth="'order.update'"
v-if="scope.row.state == 10">
提交
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="primary" @click="table_edit(scope.row)" v-auth="'order.update'"
:disabled="scope.row.state !== 10">
</el-button>
<el-button link type="primary" @click="table_edit(scope.row)" v-auth="'order.submit'"
v-if="scope.row.state == 10">
编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="danger" @click="table_del(scope.row)" v-auth="'order.delete'">
</el-button>
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'order.delete'"
v-if="scope.row.state == 10">
删除
</el-link>
</el-button>
</template>
</el-table-column>
</scTable>

View File

@ -0,0 +1,316 @@
<template>
<el-container>
<el-header style="height:60%; padding: 0">
<el-container>
<el-aside style="width: 50%">
<el-container>
<el-header>
<div class="left-panel">
<el-date-picker v-model="queryMtask.start_date" type="date" value-format="YYYY-MM-DD"
placeholder="工作日期" @change="handleQueryMtask" />
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table_mtask" :apiObj="apiMtask" row-key="id" stripe :params="paramsMtask"
:query="queryMtask" @row-click="mtaskClick">
<el-table-column label="产品名称" prop="material" show-overflow-tooltip>
<template #default="scope">
<span v-if="scope.row.material_out_">{{
scope.row.material_out_.name
}}</span>
</template>
</el-table-column>
<el-table-column label="型号规格" prop="">
<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="count_ok"> </el-table-column>
<el-table-column label="状态" prop="state">
<template #default="scope">
<el-tag v-if="scope.row.state !== 40">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else type="success">
{{ 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="table_submit(scope.row)" v-auth="'mtask.submit'"
v-if="scope.row.state != 40">提交
</el-link>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-aside>
<el-main class="nopadding">
<el-container>
<el-header style="height: 30%; padding: 0">
<el-card style="width: 100%; height: 100%">
<template #header>
<div class="card-header">
<span>任务信息</span>
</div>
</template>
<el-descriptions>
<el-descriptions-item label="任务编号">{{ currentMtask.number }}</el-descriptions-item>
<el-descriptions-item label="状态">{{ state_[currentMtask.state] }}</el-descriptions-item>
<el-descriptions-item label="产品名称">
<span v-if="currentMtask.material_out_">{{ currentMtask.material_out_.name
}}</span></el-descriptions-item>
<el-descriptions-item label="规格型号"><span v-if="currentMtask.material_out_">{{
currentMtask.material_out_.specification
}}</span></el-descriptions-item>
<el-descriptions-item label="合格数">{{ currentMtask.count_ok
}}</el-descriptions-item>
<el-descriptions-item label="不合格数">{{ currentMtask.count_notok
}}</el-descriptions-item>
</el-descriptions>
</el-card>
</el-header>
<el-main class="nopadding">
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="addMlog"
v-if="currentMtask && currentMtask.state == 20">新增</el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table_mlog" :data="mlogs" row-key="id" stripe hidePagination hideDo
@row-click="rowClick">
<el-table-column label="班次" prop="shift_name"> </el-table-column>
<el-table-column label="出管总数" prop="count_real">
</el-table-column>
<el-table-column label="规格" prop="mlogb" width="100">
<template #default="scope">
<div v-for="item in scope.row.mlogb" :key="item" class="cateItem" style="">
<span>{{ item.material_out_.name }}</span>
<span>{{ item.count_ok }}</span>
</div>
</template>
</el-table-column>
<el-table-column label="合格总数" prop="count_ok">
</el-table-column>
<el-table-column label="合格率" prop="count">
<template #default="scope">
<span>{{ scope.row.count_ok / scope.row.count_real }}</span>
</template>
</el-table-column>
<el-table-column label="不合格原因及数量" align="center">
<el-table-column label="椭圆/弯曲" prop="count_n_wq">
</el-table-column>
<el-table-column label="条纹" prop="count_n_tw">
</el-table-column>
<el-table-column label="断裂" prop="count_n_dl">
</el-table-column>
<el-table-column label="偏壁" prop="count_n_pb">
</el-table-column>
<el-table-column label="大小头" prop="count_n_dxt">
</el-table-column>
<el-table-column label="结石气绒" prop="count_n_jsqx">
</el-table-column>
<el-table-column label="合计" prop="count_n_qt">
</el-table-column>
</el-table-column>
<el-table-column label="成型人" prop="handle_user_name">
</el-table-column>
<el-table-column label="带班长" prop="handle_leader_name">
</el-table-column>
<el-table-column label="碎料" prop="count_break"> </el-table-column>
<el-table-column label="操作" fixed="right" width="100" align="center">
<template #default="scope">
<el-link type="primary" @click="table_edit(scope.row)"
v-auth="'mlog.update'" v-if="scope.row.submit_time == null">编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="primary" @click="table_del(scope.row)" v-auth="'mlog.delete'"
v-if="scope.row.submit_time == null">删除
</el-link>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-main>
</el-container>
</el-main>
</el-container>
</el-header>
<el-main class="nopadding">
<el-container>
<el-aside style="width: 50%">
<el-container>
<el-header>
<div class="left-panel">
<span style="font-size: 14px">交接记录</span>
</div>
</el-header>
<el-main>
<scTable ref="table_handover" :apiObj="apiObjHandover" row-key="id" stripe
:params="paramsHandover">
<el-table-column type="index" width="50" />
<el-table-column label="送料日期" prop="send_date">
</el-table-column>
<el-table-column label="产物" prop="material" show-overflow-tooltip>
<template #default="scope"><span v-if="scope.row.material_">{{
scope.row.material_.name
}}</span>
</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="send_user_name">
</el-table-column>
<el-table-column label="接收人" prop="recive_user_name">
</el-table-column>
<el-table-column label="是否确认" prop="submit_time">
<template #default="scope">
<span v-if="scope.row.submit_time"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="left">
<template #default="scope">
<el-button link type="primary" @click.stop="handover_submit(scope.row)"
v-auth="'handover.submit'" v-if="scope.row.submit_time == null">
确认
</el-button>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-aside>
<el-main class="nopadding">
<el-container>
<el-header>
<div class="left-panel">
<span style="font-size: 14px">车间库存</span>
</div>
<div class="right-panel">
<el-button type="primary" @click="tomio" v-auth="'mio.do'">领料</el-button>
<el-button type="primary" @click="tomio" v-auth="'mio.do'">入库</el-button>
</div>
</el-header>
<el-main>
<scTable ref="table_wm" :apiObj="apiObjWm" row-key="id" :params="paramsWm" stripe
hidePagination>
<el-table-column label="物料名" prop="material">
<template #default="scope">{{
scope.row.material_.name
}}</template>
</el-table-column>
<el-table-column label="规格" prop="material">
<template #default="scope">{{
scope.row.material_.specification
}}</template>
</el-table-column>
<el-table-column label="型号" prop="material">
<template #default="scope">{{
scope.row.material_.model
}}</template>
</el-table-column>
<el-table-column label="批次" prop="batch"> </el-table-column>
<el-table-column label="数量" prop="count" width="80">
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-main>
</el-container>
</el-main>
</el-container>
</template>
<script>
export default {
data() {
return {
currentDept: {},
currentMtask: {},
apiMtask: null,
paramsMtask: {},
queryMtask: {},
state_: {
10: "创建中",
20: "已下达",
30: "生产中",
40: "已提交",
},
apiObjHandover: null,
paramsHandover: {},
apiObjWm: null,
paramsWm: {},
}
},
mounted() {
this.initDept()
},
methods: {
initDept() {
this.$API.system.dept.list.req({ page: 0, name: '10车间' }).then(res => {
if (res.length == 1) {
this.currentDept = res[0]
this.paramsMtask.mgroup__belong_dept = this.currentDept.id
this.apiMtask = this.$API.pm.mtask.list
this.paramsHandover.recive_dept = this.currentDept.id
this.apiObjHandover = this.$API.wpm.handover.list
this.paramsWm.belong_dept = this.currentDept.id
this.apiObjWm = this.$API.wpm.wmaterial.list
} else {
this.$message.error("未找到车间");
}
})
},
handleQueryMtask() {
this.$refs.table_mtask.queryData(this.queryMtask)
},
handover_submit(row) {
this.$API.wpm.handover.submit.req(row.id).then(res => {
this.$refs.table_handover.refresh()
this.$message.success('操作成功')
}).catch(e => {
})
},
getMlogs(mtaskId) {
this.$API.wpm.mlog.list.req({ mtask: mtaskId, page: 0 }).then(res => {
this.mlogs = res
})
},
mtaskClick(row) {
this.currentMtask = row
this.getMlogs(row.id)
},
table_submit(row) {
this.$API.pm.mtask.submit.req(row.id).then(res => {
this.$message.success('操作成功')
if (row.id == this.currentMtask.id) {
this.mtaskClick(row)
}
this.$refs.table_mtask.refresh()
}).catch(err => {
})
}
}
}
</script>

View File

@ -0,0 +1,7 @@
<template>
<div>
</div>
</template>
<script>
</script>

View File

@ -0,0 +1,322 @@
<template>
<el-container>
<el-header style="height:60%; padding: 0">
<el-container>
<el-aside style="width: 50%">
<el-container>
<el-header>
<div class="left-panel">
<el-date-picker v-model="queryMtask.start_date" type="date" value-format="YYYY-MM-DD"
placeholder="工作日期" @change="handleQueryMtask" />
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table_mtask" :apiObj="apiMtask" row-key="id" stripe :params="paramsMtask"
:query="queryMtask" @row-click="mtaskClick">
<el-table-column label="产品名称" prop="material" show-overflow-tooltip>
<template #default="scope">
<span v-if="scope.row.material_out_">{{
scope.row.material_out_.name
}}</span>
</template>
</el-table-column>
<el-table-column label="型号规格" prop="">
<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="count_ok"> </el-table-column>
<el-table-column label="状态" prop="state">
<template #default="scope">
<el-tag v-if="scope.row.state !== 40">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else type="success">
{{ 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="table_submit(scope.row)" v-auth="'mtask.submit'"
v-if="scope.row.state != 40">提交
</el-link>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-aside>
<el-main class="nopadding">
<el-container>
<el-header style="height: 30%; padding: 0">
<el-card style="width: 100%; height: 100%">
<template #header>
<div class="card-header">
<span>任务信息</span>
</div>
</template>
<el-descriptions>
<el-descriptions-item label="任务编号">{{ currentMtask.number }}</el-descriptions-item>
<el-descriptions-item label="状态">{{ state_[currentMtask.state] }}</el-descriptions-item>
<el-descriptions-item label="产品名称">
<span v-if="currentMtask.material_out_">{{ currentMtask.material_out_.name
}}</span></el-descriptions-item>
<el-descriptions-item label="规格型号"><span v-if="currentMtask.material_out_">{{
currentMtask.material_out_.specification
}}</span></el-descriptions-item>
<el-descriptions-item label="合格数">{{ currentMtask.count_ok
}}</el-descriptions-item>
<el-descriptions-item label="不合格数">{{ currentMtask.count_notok
}}</el-descriptions-item>
</el-descriptions>
</el-card>
</el-header>
<el-main class="nopadding">
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="addMlog"
v-if="currentMtask && currentMtask.state == 20">新增</el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table_mlog" :data="mlogs" row-key="id" stripe hidePagination hideDo
@row-click="rowClick">
<el-table-column label="锅号" prop="equipment_name">
</el-table-column>
<el-table-column label="产品名称" prop="material_out_">
<template #default="scope">
<span v-if="scope.row.material_out_">{{
scope.row.material_out_.name
}}</span>
</template>
</el-table-column>
<el-table-column label="规格" prop="material_out_">
<template #default="scope">
<span v-if="scope.row.material_out_">{{
scope.row.material_out_.specification
}}</span>
</template>
</el-table-column>
<el-table-column label="生产量" prop="count_real">
</el-table-column>
<el-table-column label="合格量" prop="count_ok"> </el-table-column>
<el-table-column label="合格率" prop="count">
<template #default="scope">
<span>{{ scope.row.count_ok / scope.row.count_real }}</span>
</template>
</el-table-column>
<el-table-column label="不合格原因及数量" align="center">
<el-table-column label="炸纹" prop="count_n_zw">
</el-table-column>
<el-table-column label="条纹" prop="count_n_tw">
</el-table-column>
<el-table-column label="气泡" prop="count_n_qp">
</el-table-column>
<el-table-column label="弯曲" prop="count_n_wq">
</el-table-column>
<el-table-column label="其他" prop="count_n_qt">
</el-table-column>
<el-table-column label="合计" prop="count_n_qt">
</el-table-column>
</el-table-column>
<el-table-column label="退火炉号" prop="equipment_2_name">
</el-table-column>
<el-table-column label="第几锅" prop="index"> </el-table-column>
<el-table-column label="成型人" prop="handle_user_name">
</el-table-column>
<el-table-column label="切料人" prop="handle_user_2_name">
</el-table-column>
<el-table-column label="操作" fixed="right" width="100" align="center">
<template #default="scope">
<el-link type="primary" @click="table_edit(scope.row)"
v-auth="'mlog.update'" v-if="scope.row.submit_time == null">编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="primary" @click="table_del(scope.row)" v-auth="'mlog.delete'"
v-if="scope.row.submit_time == null">删除
</el-link>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-main>
</el-container>
</el-main>
</el-container>
</el-header>
<el-main class="nopadding">
<el-container>
<el-aside style="width: 50%">
<el-container>
<el-header>
<div class="left-panel">
<span style="font-size: 14px">交接记录</span>
</div>
</el-header>
<el-main>
<scTable ref="table_handover" :apiObj="apiObjHandover" row-key="id" stripe
:params="paramsHandover">
<el-table-column type="index" width="50" />
<el-table-column label="送料日期" prop="send_date">
</el-table-column>
<el-table-column label="产物" prop="material" show-overflow-tooltip>
<template #default="scope"><span v-if="scope.row.material_">{{
scope.row.material_.name
}}</span>
</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="send_user_name">
</el-table-column>
<el-table-column label="接收人" prop="recive_user_name">
</el-table-column>
<el-table-column label="是否确认" prop="submit_time">
<template #default="scope">
<span v-if="scope.row.submit_time"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="left">
<template #default="scope">
<el-button link type="primary" @click.stop="handover_submit(scope.row)"
v-auth="'handover.submit'" v-if="scope.row.submit_time == null">
确认
</el-button>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-aside>
<el-main class="nopadding">
<el-container>
<el-header>
<div class="left-panel">
<span style="font-size: 14px">车间库存</span>
</div>
<div class="right-panel">
<el-button type="primary" @click="tomio" v-auth="'mio.do'">领料</el-button>
<el-button type="primary" @click="tomio" v-auth="'mio.do'">入库</el-button>
</div>
</el-header>
<el-main>
<scTable ref="table_wm" :apiObj="apiObjWm" row-key="id" :params="paramsWm" stripe
hidePagination>
<el-table-column label="物料名" prop="material">
<template #default="scope">{{
scope.row.material_.name
}}</template>
</el-table-column>
<el-table-column label="规格" prop="material">
<template #default="scope">{{
scope.row.material_.specification
}}</template>
</el-table-column>
<el-table-column label="型号" prop="material">
<template #default="scope">{{
scope.row.material_.model
}}</template>
</el-table-column>
<el-table-column label="批次" prop="batch"> </el-table-column>
<el-table-column label="数量" prop="count" width="80">
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-main>
</el-container>
</el-main>
</el-container>
</template>
<script>
export default {
data() {
return {
currentDept: {},
currentMtask: {},
apiMtask: null,
paramsMtask: {},
queryMtask: {},
state_: {
10: "创建中",
20: "已下达",
30: "生产中",
40: "已提交",
},
apiObjHandover: null,
paramsHandover: {},
apiObjWm: null,
paramsWm: {},
}
},
mounted() {
this.initDept()
},
methods: {
initDept() {
this.$API.system.dept.list.req({ page: 0, name: '7车间' }).then(res => {
if (res.length == 1) {
this.currentDept = res[0]
this.paramsMtask.mgroup__belong_dept = this.currentDept.id
this.apiMtask = this.$API.pm.mtask.list
this.paramsHandover.recive_dept = this.currentDept.id
this.apiObjHandover = this.$API.wpm.handover.list
this.paramsWm.belong_dept = this.currentDept.id
this.apiObjWm = this.$API.wpm.wmaterial.list
} else {
this.$message.error("未找到车间");
}
})
},
handleQueryMtask() {
this.$refs.table_mtask.queryData(this.queryMtask)
},
handover_submit(row) {
this.$API.wpm.handover.submit.req(row.id).then(res => {
this.$refs.table_handover.refresh()
this.$message.success('操作成功')
}).catch(e => {
})
},
getMlogs(mtaskId) {
this.$API.wpm.mlog.list.req({ mtask: mtaskId, page: 0 }).then(res => {
this.mlogs = res
})
},
mtaskClick(row) {
this.currentMtask = row
this.getMlogs(row.id)
},
table_submit(row) {
this.$API.pm.mtask.submit.req(row.id).then(res => {
this.$message.success('操作成功')
if (row.id == this.currentMtask.id) {
this.mtaskClick(row)
}
this.$refs.table_mtask.refresh()
}).catch(err => {
})
}
}
}
</script>

267
src/views/wpm/mlog_hun.vue Normal file
View File

@ -0,0 +1,267 @@
<template>
<el-container>
<el-header style="height: 50%;padding: 0">
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add">新增</el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="params">
<el-table-column type="index" width="50" />
<el-table-column label="配料日期" prop="handle_date">
</el-table-column>
<el-table-column label="产物" prop="material" show-overflow-tooltip>
<template #default="scope"><span v-if="scope.row.material_out_">{{
scope.row.material_out_.name
}}</span>
</template>
</el-table-column>
<el-table-column label="批次" prop="batch"> </el-table-column>
<el-table-column label="数量/桶数" prop="count_real">
</el-table-column>
<el-table-column label="每桶重量/kg" prop="count_real_eweight">
</el-table-column>
<el-table-column label="配料人" prop="handle_user_name">
<template #default="scope">
<span v-for="item in scope.row.handle_users_" v-bind:key="item.id">
{{ item.name }}/
</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="180">
<template #default="scope">
<el-button link type="primary" @click="table_edit(scope.row)" v-auth="'mlog.update'">
编辑
</el-button>
<el-button link type="primary" @click="addHandover(scope.row)" v-auth="'handover.create'">
转交接单
</el-button>
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'mlog.delete'">
删除
</el-button>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-header>
<el-main class="nopadding">
<el-container>
<el-header>
<div class="left-panel">
<span style="font-size: 14px">交接记录</span>
</div>
</el-header>
<el-main>
<scTable ref="table2" :apiObj="apiObjHandover" row-key="id" stripe :params="paramsHandover">
<el-table-column type="index" width="50" />
<el-table-column label="送料日期" prop="send_date">
</el-table-column>
<el-table-column label="产物" prop="material" show-overflow-tooltip>
<template #default="scope"><span v-if="scope.row.material_">{{
scope.row.material_.name
}}</span>
</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="每桶重量/kg" prop="count_eweight">
</el-table-column>
<el-table-column label="交送人" prop="send_user_name">
</el-table-column>
<el-table-column label="接收人" prop="recive_user_name">
</el-table-column>
<el-table-column label="是否确认" prop="submit_time">
<template #default="scope">
<span v-if="scope.row.submit_time"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="left">
<template #default="scope">
<el-button link type="primary" @click="handover_edit(scope.row)" v-auth="'handover.update'"
v-if="scope.row.submit_time == null">
编辑
</el-button>
<el-button link type="danger" @click="handover_delete(scope.row)" v-auth="'handover.delete'"
v-if="scope.row.submit_time == null">
删除
</el-button>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-main>
</el-container>
<el-dialog title="交接单" ref="handoverDialog" v-model="handoverVisible" :size="1000" destroy-on-close
@closed="handoverVisible = false">
<el-form ref="dialogForm" :model="handoverForm" :rules="rules" label-width="120px">
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="送料日期" prop="send_date">
<el-date-picker v-model="handoverForm.send_date" type="date" value-format="YYYY-MM-DD"
style="width: 100%" />
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="接收部门" prop="recive_dept">
<el-select v-model="handoverForm.recive_dept" placeholder="接收部门" clearable style="width: 100%"
@change="getUserList2">
<el-option v-for="item in deptOptions" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="接收人" prop="recive_user">
<el-select v-model="handoverForm.recive_user" placeholder="接收人" clearable style="width: 100%">
<el-option v-for="item in userList2" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="交送人" prop="send_user">
<el-select v-model="handoverForm.send_user" placeholder="交送人" clearable style="width: 100%">
<el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="桶数" prop="count">
<el-input-number v-model="handoverForm.count" controls-position="right" :min="0" step="1"
:step-strictly="true" style="width:100%" placeholder="桶数">
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="每桶kg" prop="count_eweight">
<el-input-number v-model="handoverForm.count_eweight" controls-position="right" :min="0" step="1"
:step-strictly="true" style="width:100%" placeholder="每桶kg">
</el-input-number>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-footer>
<el-button @click="handoverVisible = false">取消</el-button>
<el-button type="primary" @click="submitHandover">提交</el-button>
</el-footer>
</el-dialog>
</template>
<script>
export default {
data() {
return {
currentMgroup: {},
apiObj: null,
params: {},
apiObjHandover: null,
paramsHandover: {},
handoverForm: {},
handoverVisible: false,
deptOptions: [],
userList: [],
userList2: []
}
},
mounted() {
this.initMgroup()
this.getDepts()
},
methods: {
async table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
})
.then(() => {
this.$API.wpm.mlog.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
return res;
})
.catch((err) => {
return err;
});
})
.catch(() => { });
},
getDepts() {
this.$API.system.dept.list.req({ page: 0, name__in: '7车间,10车间' }).then(res => {
this.deptOptions = res
})
},
getUserList2(val) {
this.$API.system.user.list.req({ belong_dept: val, page: 0 }).then(res => {
this.userList2 = res
})
},
initMgroup() {
this.$API.mtm.mgroup.list.req({ page: 0, name: '混料' }).then(res => {
if (res.length == 1) {
this.currentMgroup = res[0]
this.params.mgroup = this.currentMgroup.id
this.apiObj = this.$API.wpm.mlog.list
this.paramsHandover.send_mgroup = this.currentMgroup.id
this.apiObjHandover = this.$API.wpm.handover.list
this.$API.system.user.list.req({ page: 0, belong_dept: this.currentMgroup.belong_dept }).then(res => {
this.userList = res
})
} else {
this.$message.error("未找到工段");
}
})
},
//
addHandover(row) {
this.handoverForm.send_date = "";
this.handoverForm.mlog = row.id;
this.handoverForm.batch = row.batch;
this.handoverForm.count = row.count_real;
this.handoverForm.material = row.material_out;
this.handoverForm.count_eweight = row.count_real_eweight;
this.handoverForm.send_dept = row.belong_dept;
this.handoverForm.recive_dept = "";
this.handoverForm.send_user = "";
this.handoverForm.recive_user = "";
this.handoverVisible = true;
},
submitHandover() {
this.$API.wpm.handover.create.req(this.handoverForm).then((res) => {
this.$message.success("创建成功");
this.handoverVisible = false;
this.$refs.table2.refresh();
});
},
handover_edit(row) {
Object.assign(this.handoverForm, row);
this.getUserList2(row.recive_dept)
this.handoverVisible = true;
},
handover_delete(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
})
.then(() => {
this.$API.wpm.handover.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
this.$refs.table2.refresh();
return res;
})
.catch((err) => {
return err;
});
})
.catch(() => { });
},
}
}
</script>

303
src/views/wpm/mlog_tui.vue Normal file
View File

@ -0,0 +1,303 @@
<template>
<el-container>
<el-header style="height: 50%;padding: 0">
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add">新增</el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="params">
<el-table-column type="index" width="50" />
<el-table-column label="物料名" prop="material_out_name">
</el-table-column>
<el-table-column label="设备名" prop="equipment_name">
</el-table-column>
<el-table-column label="批次号" prop="batch">
</el-table-column>
<el-table-column label="操作日期" prop="handle_date">
</el-table-column>
<el-table-column label="退火数" prop="count_real">
</el-table-column>
<el-table-column label="合格数" prop="count_ok">
</el-table-column>
<el-table-column label="不合格数" prop="count_notok">
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="180">
<template #default="scope">
<el-button link type="primary" @click="table_edit(scope.row)" v-auth="'mlog.update'">
编辑
</el-button>
<el-button type="success" @click="table_submit(scope.row)" v-auth="'mlog.submit'">
提交
</el-button>
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'mlog.delete'">
删除
</el-button>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-header>
<el-main class="nopadding">
<el-container>
<el-aside style="width:50%">
<el-container>
<el-header>
<div class="left-panel">
<div class="left-panel">
<span style="font-size: 14px">交接记录</span>
</div>
</div>
</el-header>
<el-main>
<scTable ref="table2" :apiObj="apiObjHandover" row-key="id" stripe :params="paramsHandover">
<el-table-column type="index" width="50" />
<el-table-column label="送料日期" prop="send_date">
</el-table-column>
<el-table-column label="产物" prop="material" show-overflow-tooltip>
<template #default="scope"><span v-if="scope.row.material_">{{
scope.row.material_.name
}}</span>
</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="send_user_name">
</el-table-column>
<el-table-column label="接收人" prop="recive_user_name">
</el-table-column>
<el-table-column label="是否确认" prop="submit_time">
<template #default="scope">
<span v-if="scope.row.submit_time"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="left">
<template #default="scope">
<el-button link type="primary" @click="handover_edit(scope.row)"
v-auth="'handover.update'" v-if="scope.row.submit_time == null">
编辑
</el-button>
<el-button link type="danger" @click="handover_delete(scope.row)"
v-auth="'handover.delete'" v-if="scope.row.submit_time == null">
删除
</el-button>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-aside>
<el-main class="nopadding">
<el-container>
<el-header>
<div class="left-panel">
<span style="font-size: 14px">车间库存</span>
</div>
<div class="right-panel">
<el-button type="primary" @click="tomio" v-auth="'mio.do'">领料</el-button>
<el-button type="primary" @click="tomio" v-auth="'mio.do'">入库</el-button>
</div>
</el-header>
<el-main>
<scTable ref="table_wm" :apiObj="apiObjWm" row-key="id" :params="paramsWm" stripe
hidePagination>
<el-table-column label="物料名" prop="material">
<template #default="scope">{{
scope.row.material_.name
}}</template>
</el-table-column>
<el-table-column label="规格" prop="material">
<template #default="scope">{{
scope.row.material_.specification
}}</template>
</el-table-column>
<el-table-column label="型号" prop="material">
<template #default="scope">{{
scope.row.material_.model
}}</template>
</el-table-column>
<el-table-column label="批次" prop="batch"> </el-table-column>
<el-table-column label="数量" prop="count" width="80">
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-main>
</el-container>
</el-main>
</el-container>
<el-dialog title="交接单" ref="handoverDialog" v-model="handoverVisible" :size="1000" destroy-on-close
@closed="handoverVisible = false">
<el-form ref="dialogForm" :model="handoverForm" :rules="rules" label-width="120px">
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="送料日期" prop="send_date">
<el-date-picker v-model="handoverForm.send_date" type="date" value-format="YYYY-MM-DD"
style="width: 100%" />
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="接收部门" prop="recive_dept">
<el-select v-model="handoverForm.recive_dept" placeholder="接收部门" clearable style="width: 100%"
@change="getUserList2">
<el-option v-for="item in deptOptions" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="接收人" prop="recive_user">
<el-select v-model="handoverForm.recive_user" placeholder="接收人" clearable style="width: 100%">
<el-option v-for="item in userList2" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="交送人" prop="send_user">
<el-select v-model="handoverForm.send_user" placeholder="交送人" clearable style="width: 100%">
<el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="数量" prop="count">
<el-input-number v-model="handoverForm.count" controls-position="right" :min="0" step="1"
:step-strictly="true" style="width:100%" placeholder="数量">
</el-input-number>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-footer>
<el-button @click="handoverVisible = false">取消</el-button>
<el-button type="primary" @click="submitHandover">提交</el-button>
</el-footer>
</el-dialog>
</template>
<script>
export default {
data() {
return {
currentMgroup: {},
apiObj: null,
params: {},
apiObjHandover: null,
paramsHandover: {},
apiObjWm: null,
paramsWm: {},
handoverForm: {},
handoverVisible: false,
deptOptions: [],
userList: [],
userList2: [],
}
},
mounted() {
this.initMgroup()
this.getDepts()
},
methods: {
tomio() {
this.$router.push({ name: "mio" });
},
async table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
})
.then(() => {
this.$API.wpm.mlog.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
return res;
})
.catch((err) => {
return err;
});
})
.catch(() => { });
},
getDepts() {
this.$API.system.dept.list.req({ page: 0, name__in: '7车间,10车间' }).then(res => {
this.deptOptions = res
})
},
getUserList2(val) {
this.$API.system.user.list.req({ belong_dept: val, page: 0 }).then(res => {
this.userList2 = res
})
},
initMgroup() {
this.$API.mtm.mgroup.list.req({ page: 0, name: '管料退火' }).then(res => {
if (res.length == 1) {
this.currentMgroup = res[0]
this.params.mgroup = this.currentMgroup.id
this.apiObj = this.$API.wpm.mlog.list
this.paramsHandover.send_mgroup = this.currentMgroup.id
this.apiObjHandover = this.$API.wpm.handover.list
this.paramsWm.belong_dept = this.currentMgroup.belong_dept
this.apiObjWm = this.$API.wpm.wmaterial.list
this.$API.system.user.list.req({ page: 0, belong_dept: this.currentMgroup.belong_dept }).then(res => {
this.userList = res
})
} else {
this.$message.error("未找到工段");
}
})
},
//
addHandover(row) {
this.handoverForm.send_date = "";
this.handoverForm.mlog = row.id;
this.handoverForm.batch = row.batch;
this.handoverForm.count = row.count_real;
this.handoverForm.material = row.material_out;
this.handoverForm.count_eweight = row.count_real_eweight;
this.handoverForm.send_dept = row.belong_dept;
this.handoverForm.recive_dept = "";
this.handoverForm.send_user = "";
this.handoverForm.recive_user = "";
this.handoverVisible = true;
},
submitHandover() {
this.$API.wpm.handover.create.req(this.handoverForm).then((res) => {
this.$message.success("创建成功");
this.handoverVisible = false;
this.$refs.table2.refresh();
});
},
handover_edit(row) {
Object.assign(this.handoverForm, row);
this.getUserList2(row.recive_dept)
this.handoverVisible = true;
},
handover_delete(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
})
.then(() => {
this.$API.wpm.handover.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
this.$refs.table2.refresh();
return res;
})
.catch((err) => {
return err;
});
})
.catch(() => { });
},
}
}
</script>

View File

@ -1,69 +1,26 @@
<template>
<el-container style="flex-direction: column">
<el-main
id="topContainer"
class="nopadding"
style="position: relative; height: 50%; margin-bottom: 10px"
>
<el-main id="topContainer" class="nopadding" style="position: relative; height: 50%; margin-bottom: 10px">
<el-row :gutter="10">
<el-col
:span="activeSpan"
style="border-right: 1px solid #eeeeee; position: relative"
>
<el-col :span="activeSpan" style="border-right: 1px solid #eeeeee; position: relative">
<div class="right-panel btnWrap">
<el-button
v-if="activeName == '8车间' || activeName == '退火'"
type="primary"
icon="el-icon-plus"
@click="add"
>新增</el-button
>
<el-button
v-if="activeName == '退火'"
type="primary"
@click="submittuihuo"
>提交</el-button
>
<el-date-picker
v-if="activeName == '7车间' || activeName == '10车间'"
v-model="paramsDate"
type="date"
value-format="YYYY-MM-DD"
/>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuerys"
v-if="activeName == '7车间' || activeName == '10车间'"
>查询</el-button
>
<el-button v-if="activeName == '8车间' || activeName == '退火'" type="primary" icon="el-icon-plus"
@click="add">新增</el-button>
<el-button v-if="activeName == '退火'" type="primary" @click="submittuihuo">提交</el-button>
<el-date-picker v-if="activeName == '7车间' || activeName == '10车间'" v-model="paramsDate" type="date"
value-format="YYYY-MM-DD" />
<el-button type="primary" icon="el-icon-search" @click="handleQuerys"
v-if="activeName == '7车间' || activeName == '10车间'">查询</el-button>
</div>
<el-tabs
v-model="activeName"
class="demo-tabs"
@tab-click="handleClick"
>
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
<el-tab-pane label="混料工序" name="8车间">
<scTable
ref="table8"
:apiObj="apiObjMlog"
row-key="id"
stripe
:height="tableHeightHalf"
:params="params8"
hidePagination
hideDo
>
<scTable ref="table8" :apiObj="apiObjMlog" row-key="id" stripe :height="tableHeightHalf" :params="params8"
hidePagination hideDo>
<el-table-column type="index" width="50" />
<el-table-column label="配料日期" prop="handle_date">
</el-table-column>
<el-table-column
label="产物"
prop="material"
show-overflow-tooltip
>
<template #default="scope"
><span v-if="scope.row.material_out_">{{
<el-table-column label="产物" prop="material" show-overflow-tooltip>
<template #default="scope"><span v-if="scope.row.material_out_">{{
scope.row.material_out_.name
}}</span>
</template>
@ -75,70 +32,36 @@
</el-table-column>
<el-table-column label="配料人" prop="handle_user_name">
<template #default="scope">
<span
v-for="item in scope.row.handle_users_"
v-bind:key="item.id"
>
<span v-for="item in scope.row.handle_users_" v-bind:key="item.id">
{{ item.name }}/
</span>
</template>
</el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="180"
>
<el-table-column label="操作" fixed="right" align="center" width="180">
<template #default="scope">
<el-link
type="primary"
@click="table_edit(scope.row)"
v-auth="'equipment'"
>
<el-link type="primary" @click="table_edit(scope.row)" v-auth="'equipment'">
编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link
type="primary"
@click="addHandover(scope.row)"
v-auth="'equipment'"
>
<el-link type="primary" @click="addHandover(scope.row)" v-auth="'equipment'">
转交接单
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link
type="danger"
@click="table_del(scope.row, '8车间')"
v-auth="'equipment'"
>
<el-link type="danger" @click="table_del(scope.row, '8车间')" v-auth="'equipment'">
删除
</el-link>
</template>
</el-table-column>
</scTable>
<div class="tableTitle">交接记录</div>
<scTable
ref="table8_2"
:apiObj="apiObjHandover"
row-key="id"
stripe
:height="tableHeightHalf"
:params="params82"
hidePagination
hideDo
@selection-change="handleSelectionChange"
>
<scTable ref="table8_2" :apiObj="apiObjHandover" row-key="id" stripe :height="tableHeightHalf"
:params="params82" hidePagination hideDo @selection-change="handleSelectionChange">
<el-table-column type="index" width="50" />
<el-table-column type="selection" width="40" />
<el-table-column label="送料日期" prop="send_date">
</el-table-column>
<el-table-column
label="产物"
prop="material"
show-overflow-tooltip
>
<template #default="scope"
><span v-if="scope.row.material_">{{
<el-table-column label="产物" prop="material" show-overflow-tooltip>
<template #default="scope"><span v-if="scope.row.material_">{{
scope.row.material_.name
}}</span>
</template>
@ -154,19 +77,11 @@
</el-table-column>
<el-table-column label="操作" fixed="right" align="left">
<template #default="scope">
<el-link
type="primary"
@click="handover_edit(scope.row)"
v-auth="'equipment'"
>
<el-link type="primary" @click="handover_edit(scope.row)" v-auth="'equipment'">
编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link
type="danger"
@click="delHandover2(scope.row, '8车间')"
v-auth="'equipment'"
>
<el-link type="danger" @click="delHandover2(scope.row, '8车间')" v-auth="'equipment'">
删除
</el-link>
</template>
@ -174,16 +89,8 @@
</scTable>
</el-tab-pane>
<el-tab-pane label="退火" name="退火">
<scTable
ref="table8_3"
:apiObj="apiObjMlog"
row-key="id"
stripe
:height="tableHeightHalf"
:params="paramsth"
hidePagination
hideDo
>
<scTable ref="table8_3" :apiObj="apiObjMlog" row-key="id" stripe :height="tableHeightHalf"
:params="paramsth" hidePagination hideDo>
<el-table-column type="index" width="50" />
<el-table-column label="合格数" prop="equipment_name">
</el-table-column>
@ -199,34 +106,17 @@
</el-table-column>
<el-table-column label="检测不合格原因" prop="handle_user_name">
</el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="180"
>
<el-table-column label="操作" fixed="right" align="center" width="180">
<template #default="scope">
<el-link
type="primary"
@click="table_edit(scope.row)"
v-auth="'equipment'"
>
<el-link type="primary" @click="table_edit(scope.row)" v-auth="'equipment'">
编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link
type="success"
@click="table_tuihuo_submit(scope.row)"
v-auth="'equipment'"
>
<el-link type="success" @click="table_tuihuo_submit(scope.row)" v-auth="'equipment'">
提交
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link
type="danger"
@click="table_del(scope.row, '8车间')"
v-auth="'equipment'"
>
<el-link type="danger" @click="table_del(scope.row, '8车间')" v-auth="'equipment'">
删除
</el-link>
</template>
@ -237,32 +127,15 @@
<div class="tableTitle">
交接记录
<div class="right-panel btnWrap">
<el-button
type="primary"
icon="el-icon-plus"
@click="addHandover2"
>新增</el-button
>
<el-button type="primary" icon="el-icon-plus" @click="addHandover2">新增</el-button>
</div>
</div>
<scTable
ref="table8_4"
:apiObj="apiObjHandover"
row-key="id"
stripe
:height="tableHeightHalf"
:params="params84"
hidePagination
hideDo
>
<scTable ref="table8_4" :apiObj="apiObjHandover" row-key="id" stripe :height="tableHeightHalf"
:params="params84" hidePagination hideDo>
<el-table-column type="index" width="50" />
<el-table-column label="交接日期" prop="send_date">
</el-table-column>
<el-table-column
label="批次号"
prop="batch"
show-overflow-tooltip
>
<el-table-column label="批次号" prop="batch" show-overflow-tooltip>
</el-table-column>
<el-table-column label="交送人" prop="send_user_name">
</el-table-column>
@ -270,26 +143,13 @@
</el-table-column>
<el-table-column label="数量" prop="count">
</el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="180"
>
<el-table-column label="操作" fixed="right" align="center" width="180">
<template #default="scope">
<el-link
type="primary"
@click="editHandover2(scope.row)"
v-auth="'equipment'"
>
<el-link type="primary" @click="editHandover2(scope.row)" v-auth="'equipment'">
编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link
type="danger"
@click="delHandover2(scope.row, '8车间')"
v-auth="'equipment'"
>
<el-link type="danger" @click="delHandover2(scope.row, '8车间')" v-auth="'equipment'">
删除
</el-link>
</template>
@ -304,17 +164,8 @@
<el-button type="primary" @click="tomio">入库</el-button>
</div>
</div>
<scTable
ref="table8wM"
:apiObj="apiObjMetarial"
row-key="id"
stripe
:height="tableHeightHalf"
:params="paramsMaterial"
hidePagination
hideDo
@selection-change="handleSelectionChange"
>
<scTable ref="table8wM" :apiObj="apiObjMetarial" row-key="id" stripe :height="tableHeightHalf"
:params="paramsMaterial" hidePagination hideDo @selection-change="handleSelectionChange">
<el-table-column label="物料名" prop="material">
<template #default="scope">{{
scope.row.material_.name
@ -358,22 +209,10 @@
</el-row>
</el-tab-pane>
<el-tab-pane label="7车间" name="7车间">
<scTable
ref="table7"
:apiObj="apiObjMtask"
row-key="id"
stripe
:height="tableHeight"
:params="params7"
hideDo
@row-click="rowClick"
>
<scTable ref="table7" :apiObj="apiObjMtask" row-key="id" stripe :height="tableHeight" :params="params7"
hideDo @row-click="rowClick">
<el-table-column type="index" width="50" />
<el-table-column
label="产品名称"
prop="material"
show-overflow-tooltip
>
<el-table-column label="产品名称" prop="material" show-overflow-tooltip>
<template #default="scope">
<span v-if="scope.row.material_out_">{{
scope.row.material_out_.name
@ -408,34 +247,18 @@
</el-table-column>
<el-table-column label="操作" fixed="right" width="60">
<template #default="scope">
<el-link
type="primary"
@click="table_submit(scope.row)"
v-auth="'equipment'"
v-if="scope.row.state != 40"
>提交
<el-link type="primary" @click="table_submit(scope.row)" v-auth="'equipment'"
v-if="scope.row.state != 40">提交
</el-link>
</template>
</el-table-column>
</scTable>
</el-tab-pane>
<el-tab-pane label="10车间" name="10车间">
<scTable
ref="table10"
:apiObj="apiObjMtask"
row-key="id"
stripe
:height="tableHeight"
:params="params10"
hideDo
@row-click="rowClick"
>
<scTable ref="table10" :apiObj="apiObjMtask" row-key="id" stripe :height="tableHeight" :params="params10"
hideDo @row-click="rowClick">
<el-table-column type="index" width="50" />
<el-table-column
label="产品名称"
prop="material"
show-overflow-tooltip
>
<el-table-column label="产品名称" prop="material" show-overflow-tooltip>
<template #default="scope">
<span v-if="scope.row.material_out_">{{
scope.row.material_out_.name
@ -463,12 +286,8 @@
</el-table-column>
<el-table-column label="操作" fixed="right" width="60">
<template #default="scope">
<el-link
type="primary"
@click="table_submit(scope.row)"
v-auth="'equipment'"
v-if="scope.row.state != 40"
>提交
<el-link type="primary" @click="table_submit(scope.row)" v-auth="'equipment'"
v-if="scope.row.state != 40">提交
</el-link>
</template>
</el-table-column>
@ -476,10 +295,7 @@
</el-tab-pane>
</el-tabs>
</el-col>
<el-col
:span="12"
v-if="activeName == '7车间' || activeName == '10车间'"
>
<el-col :span="12" v-if="activeName == '7车间' || activeName == '10车间'">
<el-card>
<el-form label-width="100px">
<el-row>
@ -519,24 +335,12 @@
</el-form>
</el-card>
<div style="margin-top: 10px">
<el-button
type="primary"
icon="el-icon-plus"
@click="add"
:disabled="choseData && choseData.state == 40"
>新增</el-button
>
<el-button type="primary" icon="el-icon-plus" @click="add"
:disabled="choseData && choseData.state == 40">新增</el-button>
</div>
<!-- 7车间 -->
<scTable
ref="table"
:data="flogs"
row-key="id"
stripe
:height="rightHeight"
:params="query"
v-if="activeName == '7车间'"
>
<scTable ref="table" :data="flogs" row-key="id" stripe :height="rightHeight" :params="query"
v-if="activeName == '7车间'">
<el-table-column type="index" width="40" />
<el-table-column label="锅号" prop="equipment_name">
</el-table-column>
@ -583,52 +387,27 @@
</el-table-column>
<el-table-column label="切料人" prop="handle_user_2_name">
</el-table-column>
<el-table-column
label="操作"
fixed="right"
width="100"
align="center"
>
<el-table-column label="操作" fixed="right" width="100" align="center">
<template #default="scope">
<el-link
type="primary"
@click="table_edit(scope.row)"
v-auth="'equipment'"
:disabled="choseData.state == 40"
>编辑
<el-link type="primary" @click="table_edit(scope.row)" v-auth="'equipment'"
:disabled="choseData.state == 40">编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link
type="primary"
@click="table_del(scope.row)"
:disabled="choseData.state == 40"
>删除
<el-link type="primary" @click="table_del(scope.row)" :disabled="choseData.state == 40">删除
</el-link>
</template>
</el-table-column>
</scTable>
<!-- 10车间 -->
<scTable
ref="table"
:data="flogs"
row-key="id"
stripe
:height="rightHeight"
:params="query"
v-if="activeName == '10车间'"
>
<scTable ref="table" :data="flogs" row-key="id" stripe :height="rightHeight" :params="query"
v-if="activeName == '10车间'">
<el-table-column type="index" width="40" />
<el-table-column label="班次" prop="shift_name"> </el-table-column>
<el-table-column label="出管总数" prop="count_real">
</el-table-column>
<el-table-column label="规格" prop="mlogb" width="100">
<template #default="scope">
<div
v-for="item in scope.row.mlogb"
:key="item"
class="cateItem"
style=""
>
<div v-for="item in scope.row.mlogb" :key="item" class="cateItem" style="">
<span>{{ item.material_out_.name }}</span>
<span>{{ item.count_ok }}</span>
</div>
@ -662,26 +441,13 @@
<el-table-column label="带班长" prop="handle_leader_name">
</el-table-column>
<el-table-column label="碎料" prop="count"> </el-table-column>
<el-table-column
label="操作"
fixed="right"
width="100"
align="center"
>
<el-table-column label="操作" fixed="right" width="100" align="center">
<template #default="scope">
<el-link
type="primary"
@click="table_edit(scope.row)"
v-auth="'equipment'"
:disabled="choseData.state == 40"
>编辑
<el-link type="primary" @click="table_edit(scope.row)" v-auth="'equipment'"
:disabled="choseData.state == 40">编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link
type="primary"
:disabled="choseData.state == 40"
@click="table_del(scope.row)"
>删除
<el-link type="primary" :disabled="choseData.state == 40" @click="table_del(scope.row)">删除
</el-link>
</template>
</el-table-column>
@ -693,16 +459,8 @@
<el-button type="primary" @click="tomio">入库</el-button>
</div>
</div>
<scTable
ref="table8wM"
:apiObj="apiObjMetarial"
row-key="id"
stripe
:height="300"
:params="paramsMaterial"
hidePagination
hideDo
>
<scTable ref="table8wM" :apiObj="apiObjMetarial" row-key="id" stripe :height="300" :params="paramsMaterial"
hidePagination hideDo>
<el-table-column label="物料名" prop="material">
<template #default="scope">{{
scope.row.material_.name
@ -725,96 +483,40 @@
</el-col>
</el-row>
</el-main>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
:mtask="mtask"
:brothersList="brothersList"
:activeType="activeName"
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
<save-dialog v-if="dialog.save" ref="saveDialog" :mtask="mtask" :brothersList="brothersList" :activeType="activeName"
@success="handleSaveSuccess" @closed="dialog.save = false"></save-dialog>
<handover-dialog
v-if="dialog.handover"
ref="handoverDialog2"
@success="handleSuccess"
@closed="dialog.handover = false"
></handover-dialog>
<el-dialog
title="交接单"
ref="handoverDialog"
v-model="handoverVisible"
:size="1000"
destroy-on-close
@closed="handoverVisible = false"
>
<el-form
ref="dialogForm"
:model="handoverForm"
:rules="rules"
label-width="120px"
>
<handover-dialog v-if="dialog.handover" ref="handoverDialog2" @success="handleSuccess"
@closed="dialog.handover = false"></handover-dialog>
<el-dialog title="交接单" ref="handoverDialog" v-model="handoverVisible" :size="1000" destroy-on-close
@closed="handoverVisible = false">
<el-form ref="dialogForm" :model="handoverForm" :rules="rules" label-width="120px">
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="送料日期" prop="send_date">
<el-date-picker
v-model="handoverForm.send_date"
type="date"
value-format="YYYY-MM-DD"
style="width: 100%"
/>
<el-date-picker v-model="handoverForm.send_date" type="date" value-format="YYYY-MM-DD"
style="width: 100%" />
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="接收部门" prop="recive_dept">
<el-select
v-model="handoverForm.recive_dept"
placeholder="接收部门"
clearable
style="width: 100%"
@change="getUserList2"
>
<el-option
v-for="item in group"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
<el-select v-model="handoverForm.recive_dept" placeholder="接收部门" clearable style="width: 100%"
@change="getUserList2">
<el-option v-for="item in group" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="接收人" prop="recive_user">
<el-select
v-model="handoverForm.recive_user"
placeholder="接收人"
clearable
style="width: 100%"
>
<el-option
v-for="item in userList2"
:key="item.id"
:label="item.name"
:value="item.id"
/>
<el-select v-model="handoverForm.recive_user" placeholder="接收人" clearable style="width: 100%">
<el-option v-for="item in userList2" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="交送人" prop="send_user">
<el-select
v-model="handoverForm.send_user"
placeholder="交送人"
clearable
style="width: 100%"
>
<el-option
v-for="item in userList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
<el-select v-model="handoverForm.send_user" placeholder="交送人" clearable style="width: 100%">
<el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
@ -910,7 +612,7 @@ export default {
},
params82: {
send_dept__name: "8车间",
material__type: 10,
material__type: 30,
},
paramsth: {
mgroup__name: "管料退火",