1026修改
This commit is contained in:
parent
0c8fd90feb
commit
e246e6f33b
|
@ -966,7 +966,7 @@ const routes = [
|
|||
"name": "samOrder",
|
||||
"path": "/sam/samOrder",
|
||||
"meta": {
|
||||
"title": "订单",
|
||||
"title": "订单管理",
|
||||
"icon": "el-icon-cellphone",
|
||||
"perms": ["sam"]
|
||||
},
|
||||
|
|
|
@ -1,43 +1,40 @@
|
|||
<template>
|
||||
<el-container style="flex-direction: column">
|
||||
<el-main id="topContainer" class="nopadding" style="position: relative;margin-bottom: 10px;">
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<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="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>
|
||||
<div class="right-panel btnsContainer">
|
||||
<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="utaskAssgin" v-loading="isloading">任务下达</el-button>
|
||||
</div>
|
||||
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
|
||||
<el-tab-pane label="混料工序" name="8车间">
|
||||
<scTable
|
||||
ref="table"
|
||||
ref="table8"
|
||||
:apiObj="apiUtask"
|
||||
row-key="id"
|
||||
stripe
|
||||
:height="topHeight"
|
||||
:params="paramsUtask8"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="index" width="50"/>
|
||||
<el-table-column type="selection" width="40" />
|
||||
<el-table-column type="index" width="40" />
|
||||
<el-table-column label="任务编号" prop="number">
|
||||
</el-table-column>
|
||||
<el-table-column label="产品名称" prop="material" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column label="型号" prop="number">
|
||||
</el-table-column>
|
||||
<el-table-column label="任务状态" prop="state">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.state!==40" type="primary">
|
||||
{{ 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="number">
|
||||
</el-table-column>
|
||||
<el-table-column label="计划量" prop="count">
|
||||
|
@ -54,41 +51,51 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="要求描述" prop="count">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="left" width="120">
|
||||
<template #default="scope">
|
||||
<el-link
|
||||
type="primary"
|
||||
@click="table_edit(scope.row)"
|
||||
v-auth="'pu_plan.update'"
|
||||
>编辑
|
||||
<el-table-column label="操作" fixed="right" width="150">
|
||||
<template #default="scope">
|
||||
<el-link type="primary" @click="table_show(scope.row)">
|
||||
查看
|
||||
</el-link>
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
<el-link
|
||||
type="danger"
|
||||
@click="table_del(scope.row)"
|
||||
v-auth="'pu_plan.delete'"
|
||||
>删除
|
||||
<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>
|
||||
</template>
|
||||
<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>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="成型7车间" name="7车间">
|
||||
<scTable
|
||||
ref="table"
|
||||
ref="table7"
|
||||
:apiObj="apiUtask"
|
||||
row-key="id"
|
||||
stripe
|
||||
:height="topHeight"
|
||||
:params="paramsUtask7"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="index" width="50"/>
|
||||
<el-table-column type="selection" width="40" />
|
||||
<el-table-column type="index" width="40" />
|
||||
<el-table-column label="任务编号" prop="number">
|
||||
</el-table-column>
|
||||
<el-table-column label="产品名称" prop="material" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column label="型号" prop="number">
|
||||
</el-table-column>
|
||||
<el-table-column label="任务状态" prop="state">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.state!==40" type="primary">
|
||||
{{ 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="number">
|
||||
</el-table-column>
|
||||
<el-table-column label="计划量" prop="count">
|
||||
|
@ -105,41 +112,51 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="要求描述" prop="count">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="left" width="120">
|
||||
<template #default="scope">
|
||||
<el-link
|
||||
type="primary"
|
||||
@click="table_edit(scope.row)"
|
||||
v-auth="'pu_plan.update'"
|
||||
>编辑
|
||||
<el-table-column label="操作" fixed="right" width="150">
|
||||
<template #default="scope">
|
||||
<el-link type="primary" @click="table_show(scope.row)">
|
||||
查看
|
||||
</el-link>
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
<el-link
|
||||
type="danger"
|
||||
@click="table_del(scope.row)"
|
||||
v-auth="'pu_plan.delete'"
|
||||
>删除
|
||||
<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>
|
||||
</template>
|
||||
<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>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="成型10车间" name="10车间">
|
||||
<scTable
|
||||
ref="table"
|
||||
ref="table10"
|
||||
:apiObj="apiUtask"
|
||||
row-key="id"
|
||||
stripe
|
||||
:height="topHeight"
|
||||
:params="paramsUtask10"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="index" width="50"/>
|
||||
<el-table-column type="selection" width="40" />
|
||||
<el-table-column type="index" width="40" />
|
||||
<el-table-column label="任务编号" prop="number">
|
||||
</el-table-column>
|
||||
<el-table-column label="产品名称" prop="material" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column label="型号" prop="number">
|
||||
</el-table-column>
|
||||
<el-table-column label="任务状态" prop="state">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.state!==40" type="primary">
|
||||
{{ 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="number">
|
||||
</el-table-column>
|
||||
<el-table-column label="计划量" prop="count">
|
||||
|
@ -156,24 +173,20 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="要求描述" prop="count">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="left" width="120">
|
||||
<template #default="scope">
|
||||
<el-link
|
||||
type="primary"
|
||||
@click="table_edit(scope.row)"
|
||||
v-auth="'pu_plan.update'"
|
||||
>
|
||||
编辑
|
||||
<el-table-column label="操作" fixed="right" width="150">
|
||||
<template #default="scope">
|
||||
<el-link type="primary" @click="table_show(scope.row)">
|
||||
查看
|
||||
</el-link>
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
<el-link
|
||||
type="danger"
|
||||
@click="table_del(scope.row)"
|
||||
v-auth="'pu_plan.delete'"
|
||||
>
|
||||
删除
|
||||
<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>
|
||||
</template>
|
||||
<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>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-tab-pane>
|
||||
|
@ -224,7 +237,7 @@
|
|||
<el-table-column v-for="item in columList" :label="item" :key="item">
|
||||
<template #default="scope">
|
||||
<div :class="bindClass(scope.row)">
|
||||
<div>{{ scope.row.count01 }}</div>
|
||||
<div v-if="activeName=='10车间'">{{ scope.row.count01 }}</div>
|
||||
<div>{{ scope.row.count02 }}</div>
|
||||
<div>{{ scope.row.count03 }}</div>
|
||||
</div>
|
||||
|
@ -240,6 +253,57 @@
|
|||
@success="handleSaveSuccess"
|
||||
@closed="dialog.save = false"
|
||||
></save-dialog>
|
||||
<el-drawer
|
||||
title="任务详情"
|
||||
v-model="visibleRecord"
|
||||
:size="800"
|
||||
destroy-on-close
|
||||
@closed="visibleRecord=false"
|
||||
>
|
||||
<div class="right-panel tabsHeader">
|
||||
<el-date-picker
|
||||
v-model="paramsObj.start_date"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
/>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="handleDetailQuery"
|
||||
>查询</el-button>
|
||||
</div>
|
||||
<el-container v-loading="isloading">
|
||||
<el-main style="padding: 0 20px 20px 20px">
|
||||
<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" type="primary">
|
||||
{{ 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>
|
||||
import saveDialog from "./mtask_form.vue";
|
||||
|
@ -254,41 +318,47 @@ export default {
|
|||
save: false,
|
||||
},
|
||||
apiUtask: this.$API.pm.utask.list,
|
||||
paramsUtask7: { parent__isnull: true, mgroup__belong_dept__name: '7车间', material_out__is_hidden: true },
|
||||
paramsUtask8: { parent__isnull: true, mgroup__belong_dept__name: '8车间', material_out__is_hidden: true },
|
||||
paramsUtask10: { parent__isnull: true, mgroup__belong_dept__name: '10车间', material_out__is_hidden: true },
|
||||
apiObj: this.$API.pm.mtask.list,
|
||||
paramsUtask7: { belong_dept__name: '7车间' },
|
||||
paramsUtask8: { belong_dept__name: '8车间' },
|
||||
paramsUtask10: { belong_dept__name: '10车间' },
|
||||
apiObj: null,
|
||||
paramsObj:{utask:''},
|
||||
query: {
|
||||
page:1,
|
||||
page_size:20,
|
||||
date:''
|
||||
},
|
||||
utaskId:'',
|
||||
isloading:false,
|
||||
visibleRecord:false,
|
||||
tableHeight:null,
|
||||
hideDo:true,
|
||||
activeName:'10车间',
|
||||
activeName:'8车间',
|
||||
dataList:[
|
||||
{number:'rwbh2023',name:'玻璃棒',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:200, count03:300 },
|
||||
{number:'rwbh2023',name:'玻璃棒',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:250, count03:300 },
|
||||
{number:'rwbh2023',name:'玻璃棒',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:200, count03:300 },
|
||||
{number:'rwbh2023',name:'玻璃棒',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:200, count03:300 },
|
||||
{number:'rwbh2023',name:'玻璃棒',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:200, count03:300 },
|
||||
{number:'rwbh2023',name:'玻璃棒',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:200, count03:300 },
|
||||
{number:'rwbh2023',name:'玻璃棒',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:200, count03:300 },
|
||||
{number:'rwbh2023',name:'玻璃棒',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:200, count03:300 },
|
||||
{number:'rwbh2023',name:'玻璃棒',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:200, count03:300 },
|
||||
{number:'rwbh2023',name:'玻璃棒',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:200, count03:300 },
|
||||
{number:'rwbh2023',name:'玻璃棒',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:200, count03:300 },
|
||||
// {number:'rwbh2023',name:'玻璃棒',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:200, count03:300 },
|
||||
// {number:'rwbh2023',name:'玻璃棒',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:200, count03:300 },
|
||||
// {number:'rwbh2023',name:'玻璃棒',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:200, count03:300 },
|
||||
// {number:'rwbh2023',name:'玻璃棒',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:200, count03:300 },
|
||||
// {number:'rwbh2023',name:'玻璃棒',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:200, count03:300 },
|
||||
// {number:'rwbh2023',name:'玻璃棒',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:200, count03:300 },
|
||||
// {number:'rwbh2023',name:'玻璃棒',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:200, count03:300 },
|
||||
// {number:'rwbh2023',name:'玻璃棒',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:200, count03:300 },
|
||||
// {number:'rwbh2023',name:'玻璃棒',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:200, count03:300 },
|
||||
],
|
||||
columList:['10.15','10.16','10.17'],
|
||||
selection: [],
|
||||
selectedIds:[],
|
||||
state_: {
|
||||
10: '完好',
|
||||
20: '限用',
|
||||
30: '在修',
|
||||
40: '禁用',
|
||||
},
|
||||
topHeight:null,
|
||||
bottomHeight:null,
|
||||
10: '创建中',
|
||||
14: '已分解',
|
||||
20: '已下达',
|
||||
30: '生产中',
|
||||
40: '已提交'
|
||||
},
|
||||
topHeight:null,
|
||||
bottomHeight:null,
|
||||
};
|
||||
},
|
||||
mounted(){
|
||||
|
@ -307,7 +377,7 @@ export default {
|
|||
this.query.date = [startDate,endDate];
|
||||
let heights = document.getElementById('topContainer').clientHeight;
|
||||
console.log('heights',heights)
|
||||
this.topHeight = (heights-115)+'px';
|
||||
this.topHeight = (heights-45)+'px';
|
||||
this.bottomHeight = (heights-65)+'px';
|
||||
},
|
||||
methods: {
|
||||
|
@ -340,20 +410,14 @@ export default {
|
|||
this.$refs.saveDialog.open("edit").setData(row);
|
||||
});
|
||||
},
|
||||
//查看
|
||||
table_show(row) {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("show").setData(row);
|
||||
});
|
||||
},
|
||||
//删除
|
||||
async table_del(row) {
|
||||
this.$confirm(`确定删除吗?`, "提示", {
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
this.$API.pm.mtask.delete.req(row.id).then((res) => {
|
||||
this.$API.pm.utask.delete.req(row.id).then((res) => {
|
||||
this.$message.success("删除成功");
|
||||
this.$refs.table7.refresh();
|
||||
return res;
|
||||
}).catch((err) => {
|
||||
return err;
|
||||
|
@ -362,11 +426,9 @@ export default {
|
|||
},
|
||||
//本地更新数据
|
||||
handleSaveSuccess(data, mode) {
|
||||
if (mode == "add") {
|
||||
this.$refs.table.refresh();
|
||||
} else if (mode == "edit") {
|
||||
this.$refs.table.refresh();
|
||||
}
|
||||
this.$refs.table7.refresh();
|
||||
this.$refs.table8.refresh();
|
||||
this.$refs.table10.refresh();
|
||||
},
|
||||
handleQuery() {
|
||||
let startDate = this.query.date[0];
|
||||
|
@ -394,6 +456,54 @@ export default {
|
|||
resetQuery() {
|
||||
this.query = {};
|
||||
},
|
||||
handleSelectionChange(selection){
|
||||
this.selectedIds = [];
|
||||
selection.forEach(item => {
|
||||
this.selectedIds.push(item.id)
|
||||
});
|
||||
},
|
||||
//任务分解
|
||||
utaskDepuse(){
|
||||
let that = this;
|
||||
if(that.selectedIds.length>0){
|
||||
that.isloading = true;
|
||||
that.$API.pm.utask.scheduemtasks.req({ids:that.selectedIds}).then(res=>{
|
||||
that.$message.success('任务分解成功');
|
||||
that.isloading = false;
|
||||
that.$refs.table7.refresh();
|
||||
that.$refs.table8.refresh();
|
||||
that.$refs.table10.refresh();
|
||||
}).catch(()=>{
|
||||
that.isloading = false;
|
||||
})
|
||||
}else{
|
||||
this.$message.error('未选择任何任务')
|
||||
}
|
||||
},
|
||||
utaskAssgin(){
|
||||
let that = this;
|
||||
if(that.selectedIds.length>0){
|
||||
that.isloading = true;
|
||||
that.$API.pm.utask.assgin.req({ids:that.selectedIds}).then(res=>{
|
||||
that.$message.success('下达任务成功');
|
||||
that.isloading = false;
|
||||
that.$refs.table7.refresh();
|
||||
that.$refs.table8.refresh();
|
||||
that.$refs.table10.refresh();
|
||||
}).catch(()=>{
|
||||
that.isloading = false;
|
||||
})
|
||||
}else{
|
||||
this.$message.error('未选择任何任务')
|
||||
}
|
||||
},
|
||||
//查看
|
||||
table_show(row) {
|
||||
this.utaskId = row.id;
|
||||
this.paramsObj.utask = row.id;
|
||||
this.apiObj = this.$API.pm.mtask.list;
|
||||
this.visibleRecord = true;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -415,4 +525,11 @@ export default {
|
|||
.el-main.nopadding{
|
||||
padding:0 20px 0 20px
|
||||
}
|
||||
.btnsContainer{
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
margin-top: 4px;
|
||||
z-index: 100
|
||||
}
|
||||
</style>
|
|
@ -3,26 +3,25 @@
|
|||
<el-main id="topContainer" class="nopadding" style="position: relative;margin-bottom: 10px;">
|
||||
<div class="right-panel btnsContainer" style=" ">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="add">新增</el-button>
|
||||
<el-button type="primary" @click="utaskAssgin">任务下达</el-button>
|
||||
<el-button type="primary" @click="utaskDepuse" v-loading="isloading">任务分解</el-button>
|
||||
<el-button type="primary" @click="utaskAssgin" v-loading="isloading">任务下达</el-button>
|
||||
</div>
|
||||
<el-tabs v-model="activeName" class="demo-tabs">
|
||||
<el-tab-pane label="粗加工6车间" name="6车间">
|
||||
<scTable ref="table1" :apiObj="apiUtask" row-key="id" stripe :params="paramsUtask" :height="tableHeight" @selection-change="handleSelectionChange" hidePagination>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column type="selection" width="40" />
|
||||
<el-table-column type="index" width="40" />
|
||||
<el-table-column label="任务编号" prop="number">
|
||||
</el-table-column>
|
||||
<el-table-column label="任务状态" prop="state">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.state!==40" type="primary">
|
||||
{{ mtaskStateOptions[scope.row.state] }}
|
||||
{{ state_[scope.row.state] }}
|
||||
</el-tag>
|
||||
<el-tag v-else type="success">
|
||||
{{ mtaskStateOptions[scope.row.state] }}
|
||||
{{ state_[scope.row.state] }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<!-- <template #default="scope"><span>{{ mtaskStateOptions[scope.row.state] }}</span>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column label="任务量" prop="count">
|
||||
</el-table-column>
|
||||
|
@ -34,17 +33,17 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="完工时间" prop="end_date">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="left" width="150">
|
||||
<el-table-column label="操作" fixed="right" width="150">
|
||||
<template #default="scope">
|
||||
<el-link type="primary" @click="table_show(scope.row)">
|
||||
查看
|
||||
</el-link>
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
<el-link type="primary" @click="table_edit(scope.row)">
|
||||
<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"></el-divider>
|
||||
<el-link type="danger" @click="table_del(scope.row)">
|
||||
<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>
|
||||
|
@ -55,10 +54,10 @@
|
|||
</el-main>
|
||||
<el-main class="nopadding" style="position: relative;height: 50%;">
|
||||
<div class="right-panel btnsContainer" v-if="activeNameSub == 'order'">
|
||||
<el-button type="primary" @click="startPlan">排产</el-button>
|
||||
<!-- <el-button type="primary" @click="startPlan">排产</el-button> -->
|
||||
</div>
|
||||
<el-tabs v-model="activeNameSub" class="demo-tabs" @tab-click="handleClick">
|
||||
<el-tab-pane label="订单排产" name="order">
|
||||
<!-- <el-tab-pane label="订单排产" name="order">
|
||||
<scTable ref="table2" :apiObj="apiOrderItem" row-key="id" stripe :height="tableHeight" :params="paramsOrderItem" @selection-change="selectionOrderItemChange" hidePagination>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="订单编号" prop="number">
|
||||
|
@ -84,7 +83,7 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-tab-pane>
|
||||
</el-tab-pane> -->
|
||||
<el-tab-pane label="生产进度" name="rate">
|
||||
<GanttComponent class="left-container" :tasks="tasks"></GanttComponent>
|
||||
</el-tab-pane>
|
||||
|
@ -165,22 +164,24 @@
|
|||
</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" type="primary">
|
||||
{{ mtaskStateOptions[scope.row.state] }}
|
||||
{{ state_[scope.row.state] }}
|
||||
</el-tag>
|
||||
<el-tag v-else type="success">
|
||||
{{ mtaskStateOptions[scope.row.state] }}
|
||||
{{ state_[scope.row.state] }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-drawer>
|
||||
</el-drawer>
|
||||
</template>
|
||||
<script>
|
||||
import GanttComponent from '@/components/GanttComponent.vue';
|
||||
|
@ -193,11 +194,12 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
mtaskStateOptions: {
|
||||
state_: {
|
||||
10: '创建中',
|
||||
14: '已分解',
|
||||
20: '已下达',
|
||||
30: '进行中',
|
||||
40: '已完成'
|
||||
30: '生产中',
|
||||
40: '已提交'
|
||||
},
|
||||
ganttHeight: '500px',
|
||||
ganttLoading: false,
|
||||
|
@ -208,6 +210,7 @@ export default {
|
|||
orderitems:[],
|
||||
start_date:'',
|
||||
end_date:'',
|
||||
|
||||
},
|
||||
rules: {
|
||||
start_date: [{required: true, message: "请选择计划开工日期", trigger: "blur"}],
|
||||
|
@ -221,27 +224,22 @@ export default {
|
|||
apiUtask: this.$API.pm.utask.list,
|
||||
apiOrderItem: this.$API.sam.orderitem.list,
|
||||
paramsOrderItem: { utask__isnull: true },
|
||||
paramsUtask: { material__type: 10 },
|
||||
paramsUtask: { belong_dept__name: '6车间' },
|
||||
query: {
|
||||
page: 1,
|
||||
page_size: 20,
|
||||
date: ''
|
||||
},
|
||||
isloading:false,
|
||||
visibleRecord:false,
|
||||
isSaveing:false,
|
||||
tableHeight:null,
|
||||
activeName: '6车间',
|
||||
activeNameSub: 'order',
|
||||
activeNameSub: 'rate',
|
||||
visible:false,
|
||||
orderitemList:[],
|
||||
selectedIds:[],
|
||||
utaskDetail:[],
|
||||
state_: {
|
||||
10: '完好',
|
||||
20: '限用',
|
||||
30: '在修',
|
||||
40: '禁用',
|
||||
},
|
||||
tasks: {
|
||||
data: [
|
||||
{number:'GZ20231012',model:'GB2',cate:'100*50*2',count:300,text: "一天任务",start_date: "2023-10-12",id:'2023101800',duration: 2,progress: 1},
|
||||
|
@ -276,12 +274,32 @@ export default {
|
|||
this.selectedIds.push(item.id)
|
||||
});
|
||||
},
|
||||
//任务分解
|
||||
utaskDepuse(){
|
||||
let that = this;
|
||||
if(that.selectedIds.length>0){
|
||||
that.isloading = true;
|
||||
that.$API.pm.utask.scheduemtasks.req({ids:that.selectedIds}).then(res=>{
|
||||
that.$message.success('任务分解成功');
|
||||
that.isloading = false;
|
||||
that.$refs.table1.refresh();
|
||||
}).catch(()=>{
|
||||
that.isloading = false;
|
||||
})
|
||||
}else{
|
||||
this.$message.error('未选择任何任务')
|
||||
}
|
||||
},
|
||||
utaskAssgin(){
|
||||
let that = this;
|
||||
if(that.selectedIds.length>0){
|
||||
that.isloading = true;
|
||||
that.$API.pm.utask.assgin.req({ids:that.selectedIds}).then(res=>{
|
||||
that.$message.success('下达任务成功');
|
||||
that.ref.table1.refresh();
|
||||
that.isloading = false;
|
||||
that.$refs.table1.refresh();
|
||||
}).catch(()=>{
|
||||
that.isloading = false;
|
||||
})
|
||||
}else{
|
||||
this.$message.error('未选择任何任务')
|
||||
|
@ -354,14 +372,10 @@ export default {
|
|||
},
|
||||
//查看
|
||||
table_show(row) {
|
||||
|
||||
this.utaskId = row.id;
|
||||
this.paramsObj.utask = row.id;
|
||||
this.apiObj = this.$API.pm.mtask.list;
|
||||
this.visibleRecord = true;
|
||||
// this.$API.pm.mtask.list.req({utask:row.id}).then(re=>{
|
||||
// this.utaskDetail = res;
|
||||
// })
|
||||
},
|
||||
handleDetailQuery(){
|
||||
this.$refs.drawer_table.refresh();
|
||||
|
@ -402,6 +416,7 @@ export default {
|
|||
if (valid) {
|
||||
that.isSaveing = true;
|
||||
that.form.orderitems = that.orderitemList;
|
||||
that.form.belong_dept = '3423857962907983872';//6车间
|
||||
console.log(that.form)
|
||||
that.$API.pm.utask.schedueutasks.req(that.form).then(res=>{
|
||||
that.visible = false;
|
||||
|
|
|
@ -166,6 +166,15 @@ export default {
|
|||
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") {
|
||||
|
|
|
@ -80,9 +80,8 @@ export default {
|
|||
stateOption: {
|
||||
10: '创建中',
|
||||
20: '已提交',
|
||||
30: '已排产',
|
||||
40: '排产完成',
|
||||
50: '已交付',
|
||||
30: '进行中',
|
||||
40: '已交付',
|
||||
},
|
||||
};
|
||||
},
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
<template #default="scope">
|
||||
<span v-if="!scope.row.change">{{ scope.row.mgroup_name }}</span>
|
||||
<el-select v-else v-model="scope.row.batch" placeholder="请选择">
|
||||
<el-option v-for="item in options" :key="item" :label="item" :value="item"></el-option>
|
||||
<el-option v-for="item in processOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -120,6 +120,7 @@
|
|||
related:[],
|
||||
userList:[],
|
||||
formList: [],
|
||||
processOptions:[],
|
||||
recordId:'',
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
|
@ -136,6 +137,7 @@
|
|||
this.getBatchs();
|
||||
this.getFormList();
|
||||
this.getUserList();
|
||||
this.getProcess();
|
||||
},
|
||||
methods: {
|
||||
//显示
|
||||
|
@ -171,6 +173,12 @@
|
|||
})
|
||||
})
|
||||
},
|
||||
//获取工序列表
|
||||
getProcess(){
|
||||
var res = this.$API.mtm.process.list.req({page:0}).then(res=>{
|
||||
this.processOptions = res;
|
||||
});
|
||||
},
|
||||
//获取车间物料批次号
|
||||
getBatchs(){
|
||||
let that = this;
|
||||
|
@ -198,12 +206,6 @@
|
|||
deleteRow(){
|
||||
this.$refs.table.deleteRow(0)
|
||||
},
|
||||
|
||||
getList(){
|
||||
this.$API.mtm.material.list.req({page:0}).then(res=>{
|
||||
this.options = res;
|
||||
})
|
||||
},
|
||||
getReceptionist(data) {
|
||||
// 子组件调用父组件的方法并传参
|
||||
console.log(data);
|
||||
|
|
|
@ -4,9 +4,7 @@
|
|||
<el-row :gutter="10">
|
||||
<el-col :span="12" style="border-right: 1px solid #eeeeee;position: relative;">
|
||||
<div class="right-panel" style=" display: inline-block;position: absolute;right: 20px;margin-top: 4px;z-index:100">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="add">新增</el-button>
|
||||
<el-button type="primary" @click="add">任务下达</el-button>
|
||||
<el-button type="primary" @click="handleQuery" >导出</el-button>
|
||||
|
||||
</div>
|
||||
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
|
||||
<el-tab-pane label="混料工序" name="8车间">
|
||||
|
@ -16,7 +14,9 @@
|
|||
row-key="id"
|
||||
stripe
|
||||
:height="tableHeight"
|
||||
:params="query"
|
||||
:params="params8"
|
||||
hidePagination
|
||||
hideDo
|
||||
>
|
||||
<el-table-column type="index" width="50"/>
|
||||
<el-table-column label="产品名称" prop="material" show-overflow-tooltip>
|
||||
|
@ -44,14 +44,23 @@
|
|||
row-key="id"
|
||||
stripe
|
||||
:height="tableHeight"
|
||||
:params="query"
|
||||
:params="params7"
|
||||
hidePagination
|
||||
hideDo
|
||||
@row-click="rowClick"
|
||||
>
|
||||
<el-table-column type="index" width="50"/>
|
||||
<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="number">
|
||||
<el-table-column label="任务编号" prop="number">
|
||||
</el-table-column>
|
||||
<el-table-column label="规格" prop="number">
|
||||
<el-table-column label="型号规格" prop="">
|
||||
<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">
|
||||
</el-table-column>
|
||||
|
@ -63,6 +72,16 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="完成量" prop="count">
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" prop="state">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.state!==40" type="primary">
|
||||
{{ state_[scope.row.state] }}
|
||||
</el-tag>
|
||||
<el-tag v-else type="success">
|
||||
{{ state_[scope.row.state] }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="10车间" name="10车间">
|
||||
|
@ -72,7 +91,9 @@
|
|||
row-key="id"
|
||||
stripe
|
||||
:height="tableHeight"
|
||||
:params="query"
|
||||
:params="params10"
|
||||
hidePagination
|
||||
hideDo
|
||||
>
|
||||
<el-table-column type="index" width="50"/>
|
||||
<el-table-column label="产品名称" prop="material" show-overflow-tooltip>
|
||||
|
@ -99,17 +120,18 @@
|
|||
<el-form label-width="100px" style="border-bottom: 1px solid #eeeeee;padding: 4px 0;">
|
||||
<el-row>
|
||||
<el-col :md="8" :sm="12" :xs="24">
|
||||
<el-form-item class="infoForm" label="产品名称:"></el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="8" :sm="12" :xs="24">
|
||||
<el-form-item class="infoForm" label="产品型号:"></el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="8" :sm="12" :xs="24">
|
||||
<el-form-item class="infoForm" label="计划数量:">
|
||||
<span></span>
|
||||
<el-input></el-input>
|
||||
<el-form-item class="infoForm" label="产品名称:">
|
||||
<span v-if="choseData.material_out_">{{ choseData.material_out_.name }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="8" :sm="12" :xs="24">
|
||||
<el-form-item class="infoForm" label="产品型号:">
|
||||
<span v-if="choseData.material_out_">{{ choseData.material_out_.number }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="8" :sm="12" :xs="24">
|
||||
<el-form-item class="infoForm" label="计划数量:">{{ choseData.count }}</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div style="margin-top: 10px;">
|
||||
|
@ -138,7 +160,7 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="领料数量" prop="count">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="left" width="100">
|
||||
<el-table-column label="操作" fixed="right" width="100">
|
||||
<template #default="scope">
|
||||
<el-link
|
||||
type="primary"
|
||||
|
@ -303,13 +325,20 @@ export default {
|
|||
},
|
||||
sumLog:false,
|
||||
// apiObj: this.$API.pm.mtask.list,
|
||||
params7:{
|
||||
belong_dept_name:'7车间',
|
||||
date:'2023-10-24'
|
||||
},
|
||||
params8:{
|
||||
belong_dept_name:'8车间',
|
||||
date:'2023-10-24'
|
||||
},
|
||||
apiObj: null,
|
||||
query: {
|
||||
page:1,
|
||||
page_size:20,
|
||||
params10: {
|
||||
belong_dept_name:'10车间',
|
||||
date:'2023-10-20'
|
||||
},
|
||||
|
||||
flogs:[],
|
||||
flogsData: [{id: 1, name: 'John Doe', dob: new Date(1970,1,1)}],
|
||||
columns : [
|
||||
|
@ -317,14 +346,15 @@ export default {
|
|||
{ header: 'Name', key: 'name', wch: 15 },
|
||||
{ header: 'D.O.B.', key: 'dob', width: 32 }
|
||||
],
|
||||
activeName:'10车间',
|
||||
activeName:'8车间',
|
||||
selection: [],
|
||||
state_: {
|
||||
10: '完好',
|
||||
20: '限用',
|
||||
30: '在修',
|
||||
40: '禁用',
|
||||
10: '创建中',
|
||||
20: '已下达',
|
||||
30: '生产中',
|
||||
40: '已提交',
|
||||
},
|
||||
choseData:{},
|
||||
mtask:'',
|
||||
rightHeight:null,
|
||||
tableHeight:null,
|
||||
|
@ -351,7 +381,13 @@ export default {
|
|||
console.log('heights',heights)
|
||||
this.tableHeight = (heights-50)+'px';
|
||||
let rightHeight = heights-100;
|
||||
this.rightHeight = rightHeight/2+'px'
|
||||
this.rightHeight = rightHeight/2+'px';
|
||||
let NowDate = new Date();
|
||||
let month = NowDate.getMonth()>8?NowDate.getMonth()+1:'0'+(NowDate.getMonth()+1)
|
||||
this.params7.date = NowDate.getFullYear()+'-'+(NowDate.getMonth()+1)+'-'+NowDate.getDate();
|
||||
this.params8.date = NowDate.getFullYear()+'-'+(NowDate.getMonth()+1)+'-'+NowDate.getDate();
|
||||
this.params10.date = NowDate.getFullYear()+'-'+(NowDate.getMonth()+1)+'-'+NowDate.getDate();
|
||||
this.apiObj = this.$API.pm.mtask.daylist;
|
||||
},
|
||||
methods: {
|
||||
//获取甘特图数据
|
||||
|
@ -427,6 +463,9 @@ export default {
|
|||
sum(){
|
||||
this.sumLog = true;
|
||||
},
|
||||
rowClick(row){
|
||||
this.choseData = row
|
||||
},
|
||||
//本地更新数据
|
||||
handleSaveSuccess(data, mode) {
|
||||
if (mode == "add") {
|
||||
|
|
|
@ -28,7 +28,10 @@
|
|||
<el-table-column type="index" width="50"/>
|
||||
<el-table-column label="任务编号" prop="number">
|
||||
</el-table-column>
|
||||
<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 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品型号" prop="number">
|
||||
</el-table-column>
|
||||
|
@ -38,9 +41,17 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="计划日期" prop="count">
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" prop="count">
|
||||
<el-table-column label="状态" prop="state">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.state!==40" type="primary">
|
||||
{{ 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" align="left" width="120">
|
||||
<el-table-column label="操作" fixed="right" width="120">
|
||||
<template #default="scope">
|
||||
<el-link
|
||||
type="primary"
|
||||
|
@ -157,10 +168,10 @@ export default {
|
|||
wMaterial:[],//车间物料
|
||||
processList:[],//工序进度
|
||||
state_: {
|
||||
10: '完好',
|
||||
20: '限用',
|
||||
30: '在修',
|
||||
40: '禁用',
|
||||
10: '创建中',
|
||||
20: '已下达',
|
||||
30: '生产中',
|
||||
40: '已提交',
|
||||
},
|
||||
hideDo:true,
|
||||
topHeight:null,
|
||||
|
|
Loading…
Reference in New Issue