Merge branch 'v2' of https://e.coding.net/ctcdevteam/ehs/ehs_web into v2
This commit is contained in:
commit
9557074627
Binary file not shown.
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 10 KiB |
|
@ -7,7 +7,7 @@
|
|||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<title><%= VUE_APP_TITLE %></title>
|
||||
<!-- <script src="./jsmap/jsmap.js"> </script> -->
|
||||
<link type="text/css" href="./jsmap/jsmap.css" rel="stylesheet"/>
|
||||
<!-- <link type="text/css" href="./jsmap/jsmap.css" rel="stylesheet"/> -->
|
||||
<script type="text/javascript">
|
||||
document.write("<script src='config.js?"+new Date().getTime()+"'><\/script>");
|
||||
</script>
|
||||
|
|
|
@ -70,9 +70,9 @@ export default {
|
|||
},
|
||||
submitSameDay:{
|
||||
name: "提交同一天的该部门下的所有兄弟小任务",
|
||||
req: async function(data){
|
||||
req: async function(id,data){
|
||||
return await http.post(
|
||||
`${config.API_URL}/pm/mtask/submit_related_same_day/`,
|
||||
`${config.API_URL}/pm/mtask/${id}/submit_related_same_day/`,
|
||||
data
|
||||
);
|
||||
}
|
||||
|
|
|
@ -187,6 +187,14 @@ export default {
|
|||
`${config.API_URL}/wpm/mlog/${id}/`);
|
||||
}
|
||||
},
|
||||
relatedFirst:{
|
||||
name: "获取相关任务的第一道工序日志",
|
||||
req: async function(data){
|
||||
return await http.post(
|
||||
`${config.API_URL}/wpm/mlog/related_first/`,
|
||||
data);
|
||||
}
|
||||
}
|
||||
},
|
||||
//车间库存
|
||||
wmaterial: {
|
||||
|
|
|
@ -1865,7 +1865,7 @@ const routes = [
|
|||
"name": "bigScreenP",
|
||||
"meta": {
|
||||
"title": "数据看板",
|
||||
"icon": "el-icon-position",
|
||||
"icon": "el-icon-platform",
|
||||
"perms": ["bigScreenP"],
|
||||
"fullpage": true,
|
||||
},
|
||||
|
@ -1877,7 +1877,7 @@ const routes = [
|
|||
"name": "bigScreenP",
|
||||
"meta": {
|
||||
"title": "车间看板",
|
||||
"icon": "el-icon-position",
|
||||
"icon": "el-icon-trend-charts",
|
||||
"perms": ["bigScreenP"],
|
||||
"fullpage": true,
|
||||
},
|
||||
|
@ -1889,7 +1889,7 @@ const routes = [
|
|||
"name": "bigScreenP",
|
||||
"meta": {
|
||||
"title": "统计分析",
|
||||
"icon": "el-icon-position",
|
||||
"icon": "el-icon-histogram",
|
||||
"perms": ["bigScreenP"],
|
||||
"fullpage": true,
|
||||
},
|
||||
|
|
|
@ -28,7 +28,7 @@ a,button,input,textarea{-webkit-tap-highlight-color:rgba(0,0,0,0);box-sizing: bo
|
|||
.adminui-header-left {display: flex;align-items: center;padding-left:4px;}
|
||||
.adminui-header-right {display: flex;align-items: center;}
|
||||
.adminui-header .logo-bar {font-size: 20px;font-weight: bold;display: flex;align-items: center;}
|
||||
.adminui-header .logo-bar .logo {margin-right: 10px;height: 52px;background: #ffffff;display: inline-block;padding: 4px 10px;border-radius: 5px;margin:auto}
|
||||
.adminui-header .logo-bar .logo {margin-right: 10px;height: 52px;display: inline-block;padding: 4px;border-radius: 5px;margin:auto}
|
||||
.adminui-header .nav {display: flex;height: 100%;margin-left: 40px;}
|
||||
.adminui-header .nav li {padding:0 10px;margin: 0 10px 0 0;font-size: 14px;color: rgba(255, 255, 255, 0.6);list-style: none;height: 100%;display: flex;align-items: center;cursor: pointer;}
|
||||
.adminui-header .nav li i {margin-right: 5px;}
|
||||
|
|
|
@ -160,7 +160,7 @@
|
|||
@closed="visibleRecord=false"
|
||||
>
|
||||
<el-container v-loading="loading">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="record_create" v-auth="'equipment.create'" style="position: absolute;z-index: 10;left: 110px;top: 16px;"></el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="record_create" v-auth="'equipment'" style="position: absolute;z-index: 10;left: 110px;top: 16px;"></el-button>
|
||||
<el-main style="padding: 0 20px 20px 20px">
|
||||
<scTable
|
||||
ref="drawer_table"
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<template>
|
||||
<el-container style="flex-direction: column">
|
||||
<el-main id="topContainer" class="nopadding" style="position: relative;margin-bottom: 10px;">
|
||||
<div class="right-panel" style=" display: inline-block;position: absolute;right: 20px;margin-top: 4px;z-index: 100">
|
||||
<div class="right-panel btnsContainer" style=" ">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="add">新增</el-button>
|
||||
<el-button type="primary" @click="mtaskAssgin">任务下达</el-button>
|
||||
<el-button type="primary" @click="utaskAssgin">任务下达</el-button>
|
||||
</div>
|
||||
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
|
||||
<el-tabs v-model="activeName" class="demo-tabs">
|
||||
<el-tab-pane label="粗加工6车间" name="first">
|
||||
<scTable ref="table1" :apiObj="apiUtask" row-key="id" stripe :params="paramsMtask" :height="tableHeight" @selection-change="handleSelectionChange" hidePagination>
|
||||
<el-table-column type="selection" width="55" />
|
||||
|
@ -13,17 +13,17 @@
|
|||
<el-table-column label="任务编号" prop="number">
|
||||
</el-table-column>
|
||||
<el-table-column label="任务状态" prop="state">
|
||||
<template #default="scope"><span>{{ mtaskStateOptions[scope.row.state] }}</span>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.state!==40" type="primary">
|
||||
{{ mtaskStateOptions[scope.row.state] }}
|
||||
</el-tag>
|
||||
<el-tag v-else type="success">
|
||||
{{ mtaskStateOptions[scope.row.state] }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<!-- <template #default="scope"><span>{{ mtaskStateOptions[scope.row.state] }}</span>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="工段" prop="mgroup_name">
|
||||
<template #default="scope"><span>{{ mtaskStateOptions[scope.row.state] }}</span>
|
||||
</template>
|
||||
</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="count">
|
||||
</el-table-column>
|
||||
<el-table-column label="实际生产数" prop="count_real">
|
||||
|
@ -34,10 +34,12 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="完工时间" prop="end_date">
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="完成量" prop="count">
|
||||
</el-table-column> -->
|
||||
<el-table-column label="操作" fixed="right" align="left" width="120">
|
||||
<el-table-column label="操作" fixed="right" align="left" 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-link>
|
||||
|
@ -52,14 +54,12 @@
|
|||
</el-tabs>
|
||||
</el-main>
|
||||
<el-main class="nopadding" style="position: relative;height: 50%;">
|
||||
<div class="right-panel" v-if="activeNameSub == 'order'"
|
||||
style="display: inline-block;position: absolute;right: 20px;margin-top: 4px;">
|
||||
<div class="right-panel btnsContainer" v-if="activeNameSub == 'order'">
|
||||
<el-button type="primary" @click="startPlan">排产</el-button>
|
||||
<!-- <el-button type="primary" icon="el-icon-plus">合并任务</el-button> -->
|
||||
</div>
|
||||
<el-tabs v-model="activeNameSub" class="demo-tabs" @tab-click="handleClick">
|
||||
<el-tab-pane label="订单排产" name="order">
|
||||
<scTable ref="table2" :apiObj="apiOrderItem" row-key="id" stripe :height="tableHeight" :params="paramsOrderItem" hidePagination>
|
||||
<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">
|
||||
<template #default="scope">
|
||||
|
@ -93,13 +93,99 @@
|
|||
</el-container>
|
||||
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess"
|
||||
@closed="dialog.save = false"></save-dialog>
|
||||
<el-dialog title="排产">
|
||||
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
title="排产"
|
||||
destroy-on-close
|
||||
v-model="visible"
|
||||
@closed="closeAssginVisible"
|
||||
>
|
||||
<el-form ref="dialogForm" :model="form" :rules="rules" label-width="120px">
|
||||
<el-row>
|
||||
<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:90%"
|
||||
>
|
||||
</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:90%"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-footer>
|
||||
<el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button>
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
</el-footer>
|
||||
</el-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="loading">
|
||||
<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="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] }}
|
||||
</el-tag>
|
||||
<el-tag v-else type="success">
|
||||
{{ mtaskStateOptions[scope.row.state] }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-drawer>
|
||||
</template>
|
||||
<script>
|
||||
import GanttComponent from '@/components/GanttComponent.vue';
|
||||
import saveDialog from "./mtask_form.vue";
|
||||
import { useTransitionFallthroughEmits } from 'element-plus';
|
||||
export default {
|
||||
name: "rparty",
|
||||
components: {
|
||||
|
@ -110,6 +196,7 @@ export default {
|
|||
mtaskStateOptions: {
|
||||
10: '创建中',
|
||||
20: '已下达',
|
||||
30: '进行中',
|
||||
40: '已完成'
|
||||
},
|
||||
ganttHeight: '500px',
|
||||
|
@ -117,10 +204,20 @@ export default {
|
|||
projectId: '',
|
||||
orderitems: [],
|
||||
|
||||
|
||||
form:{
|
||||
orderitems:[],
|
||||
start_date:'',
|
||||
end_date:'',
|
||||
},
|
||||
rules: {
|
||||
start_date: [{required: true, message: "请选择计划开工日期", trigger: "blur"}],
|
||||
end_date: [{required: true, message: "请选择计划完工日期", trigger: "blur"}],
|
||||
},
|
||||
dialog: {
|
||||
save: false,
|
||||
},
|
||||
apiObj:null,
|
||||
paramsObj:{start_date:''},
|
||||
apiUtask: this.$API.pm.utask.list,
|
||||
apiOrderItem: this.$API.sam.orderitem.list,
|
||||
paramsOrderItem: { utask__isnull: true },
|
||||
|
@ -130,11 +227,15 @@ export default {
|
|||
page_size: 20,
|
||||
date: ''
|
||||
},
|
||||
visibleRecord:false,
|
||||
isSaveing:false,
|
||||
tableHeight:null,
|
||||
activeName: 'first',
|
||||
activeNameSub: 'order',
|
||||
selectedId:[],
|
||||
visible:false,
|
||||
orderitemList:[],
|
||||
selectedIds:[],
|
||||
utaskDetail:[],
|
||||
state_: {
|
||||
10: '完好',
|
||||
20: '限用',
|
||||
|
@ -156,6 +257,7 @@ export default {
|
|||
{number:'GZ20231022',model:'GB2',cate:'100*50*2',count:0, text: "一天任务", start_date: "2023-10-22",id:'20231018010',duration: 1,progress: 0.2},
|
||||
]
|
||||
},
|
||||
loading:false,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
@ -174,31 +276,31 @@ export default {
|
|||
this.selectedIds.push(item.id)
|
||||
});
|
||||
},
|
||||
mtaskAssgin(){
|
||||
if(this.selectedIds.length>0){
|
||||
|
||||
utaskAssgin(){
|
||||
let that = this;
|
||||
if(that.selectedIds.length>0){
|
||||
that.$API.pm.utask.assgin.req({ids:that.selectedIds}).then(res=>{
|
||||
that.$message.success('下达任务成功');
|
||||
that.ref.table1.refresh();
|
||||
})
|
||||
}else{
|
||||
this.$message.error('未选择任何任务')
|
||||
}
|
||||
},
|
||||
selectionChange(selection){
|
||||
this.selectedId = [];
|
||||
selectionOrderItemChange(selection){
|
||||
this.orderitemList = [];
|
||||
selection.forEach(item => {
|
||||
this.selectedId.push(item.id)
|
||||
this.orderitemList.push(item.id)
|
||||
});
|
||||
},
|
||||
// mtaskAssgin() {
|
||||
// let rows = this.$refs.table1.getSelectionRows()
|
||||
// if (rows.length == 0) {
|
||||
// this.$message.error('未选择任何任务')
|
||||
// return
|
||||
// }
|
||||
// },
|
||||
//排产
|
||||
startPlan() {
|
||||
let rows = this.$refs.table2.getSelectionRows()
|
||||
if (rows.length == 0) {
|
||||
debugger;
|
||||
let that = this;
|
||||
if(this.orderitemList.length>0){
|
||||
that.visible = true;
|
||||
}else{
|
||||
this.$message.error('未选择任何订单明细项目')
|
||||
return
|
||||
}
|
||||
},
|
||||
//获取甘特图数据
|
||||
|
@ -252,18 +354,26 @@ export default {
|
|||
},
|
||||
//查看
|
||||
table_show(row) {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("show").setData(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();
|
||||
},
|
||||
//删除
|
||||
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("删除成功");
|
||||
that.$refs.table1.refresh();
|
||||
return res;
|
||||
}).catch((err) => {
|
||||
return err;
|
||||
|
@ -285,6 +395,25 @@ export default {
|
|||
resetQuery() {
|
||||
this.query = {};
|
||||
},
|
||||
closeAssginVisible(){},
|
||||
submit(){
|
||||
let that = this;
|
||||
that.$refs.dialogForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
that.isSaveing = true;
|
||||
that.form.orderitems = that.orderitemList;
|
||||
console.log(that.form)
|
||||
that.$API.pm.utask.schedueutasks.req(that.form).then(res=>{
|
||||
that.visible = false;
|
||||
that.$message.success("操作成功");
|
||||
that.$refs.table1.refresh();
|
||||
that.$refs.table2.refresh();
|
||||
}).catch(err=>{
|
||||
that.visible = false;
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -292,7 +421,13 @@ export default {
|
|||
.el-main.nopadding {
|
||||
padding: 0 20px 0 20px
|
||||
}
|
||||
|
||||
.btnsContainer{
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
margin-top: 4px;
|
||||
z-index: 100
|
||||
}
|
||||
|
||||
.gantt-container {
|
||||
height: 30%;
|
||||
|
@ -303,4 +438,5 @@ export default {
|
|||
padding: 10px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
</style>
|
|
@ -17,7 +17,7 @@
|
|||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="任务编号" prop="number">
|
||||
<el-input v-model="form.number" placeholder="任务编号"/>
|
||||
<el-input v-model="form.number" placeholder="任务编号" :disabled="mode=='edit'"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
|
@ -32,6 +32,7 @@
|
|||
placeholder="工段"
|
||||
clearable
|
||||
style="width:100%"
|
||||
:disabled="mode=='edit'"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in processOptions"
|
||||
|
@ -42,23 +43,6 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="领用物" prop="material_before">
|
||||
<el-select
|
||||
v-model="form.material_before"
|
||||
placeholder="领用物"
|
||||
clearable
|
||||
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-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="产物" prop="material">
|
||||
<el-select
|
||||
|
@ -66,6 +50,7 @@
|
|||
placeholder="产物"
|
||||
clearable
|
||||
style="width:100%"
|
||||
:disabled="mode=='edit'"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in materialOptions"
|
||||
|
@ -77,11 +62,11 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="计划开工日期">
|
||||
<el-form-item label="开工日期" prop="start_date">
|
||||
<el-date-picker
|
||||
v-model="form.start_date"
|
||||
type="date"
|
||||
placeholder="计划开工日期"
|
||||
placeholder="开工日期"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width:100%"
|
||||
>
|
||||
|
@ -89,11 +74,11 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="计划完工日期">
|
||||
<el-form-item label="完工日期" prop="end_date">
|
||||
<el-date-picker
|
||||
v-model="form.end_date"
|
||||
type="date"
|
||||
placeholder="计划完工日期"
|
||||
placeholder="完工日期"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width:100%"
|
||||
>
|
||||
|
@ -118,20 +103,20 @@ export default {
|
|||
loading: false,
|
||||
mode: "add",
|
||||
titleMap: {
|
||||
add: "新增仓库",
|
||||
edit: "编辑仓库",
|
||||
show: "查看仓库",
|
||||
add: "新增任务",
|
||||
edit: "编辑任务",
|
||||
show: "查看任务",
|
||||
},
|
||||
form: {},
|
||||
rules: {
|
||||
name: [{required: true, message: "请输入仓库名称", trigger: "blur"}],
|
||||
number: [{required: true, message: "请输入仓库编号", trigger: "blur"}],
|
||||
place: [{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,
|
||||
keeperOptions: [],
|
||||
depOptions: [],
|
||||
materialOptions:[],
|
||||
selectionFilters: [],
|
||||
setFiltersVisible: false,
|
||||
belong_dept_options: [],
|
||||
|
@ -139,6 +124,7 @@ export default {
|
|||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getMaterial();
|
||||
},
|
||||
methods: {
|
||||
//显示
|
||||
|
@ -147,6 +133,11 @@ export default {
|
|||
this.visible = true;
|
||||
return this;
|
||||
},
|
||||
getMaterial(){
|
||||
this.$API.mtm.material.list.req({page:0}).then(res=>{
|
||||
this.materialOptions = res;
|
||||
})
|
||||
},
|
||||
//提交
|
||||
submit() {
|
||||
this.$refs.dialogForm.validate(async (valid) => {
|
||||
|
@ -155,9 +146,9 @@ export default {
|
|||
try {
|
||||
var res;
|
||||
if (this.mode == "add") {
|
||||
res = await this.$API.pm.mtask.create.req(this.form);
|
||||
res = await this.$API.pm.utask.create.req(this.form);
|
||||
} else if (this.mode == "edit") {
|
||||
res = await this.$API.pm.mtask.update.req(this.form.id,this.form);
|
||||
res = await this.$API.pm.utask.update.req(this.form.id,this.form);
|
||||
}
|
||||
this.isSaveing = false;
|
||||
this.$emit("success", this.form, this.mode);
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
destroy-on-close
|
||||
@closed="$emit('closed')"
|
||||
>
|
||||
<el-form ref="ruleForm" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form ref="saveDialog" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="产品编号" prop="material">
|
||||
<el-select
|
||||
v-model="material"
|
||||
v-model="form.batch"
|
||||
placeholder="产品编号"
|
||||
clearable
|
||||
style="width:100%"
|
||||
|
@ -26,8 +26,8 @@
|
|||
<sc-form-table ref="table" v-model="formList" :addTemplate="addTemplate" drag-sort placeholder="暂无数据">
|
||||
<el-table-column prop="type" label="工序" min-width="100">
|
||||
<template #default="scope">
|
||||
<span v-if="!scope.row.change">{{ scope.row.processName }}</span>
|
||||
<el-select v-else v-model="scope.row.process" placeholder="请选择">
|
||||
<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-select>
|
||||
</template>
|
||||
|
@ -45,7 +45,7 @@
|
|||
<el-table-column label="不合格数量" align="center">
|
||||
<el-table-column prop="val" label="原因1" width="100">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.count_no1" placeholder="不合格数量1"></el-input>
|
||||
<el-input v-model="scope.row.count_notok" placeholder="不合格数量1"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="val" label="原因2" width="100">
|
||||
|
@ -61,13 +61,14 @@
|
|||
</el-table-column>
|
||||
<el-table-column prop="type" label="操作人" min-width="120" align="center">
|
||||
<template #default="scope">
|
||||
<span style="display:flex">
|
||||
<el-input readonly v-model="scope.row.handle_user"></el-input>
|
||||
<ehsUserSelect :listIndex="index" :multiple="false" @submit="getReceptionist"/>
|
||||
</span>
|
||||
<!-- <el-select v-model="scope.row.handle_user" placeholder="请选择">
|
||||
<el-option v-for="item in typeDic" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
||||
</el-select> -->
|
||||
<el-select v-model="scope.row.handle_user" filterable style="width: 100%" :disabled="bindType == 20">
|
||||
<el-option
|
||||
v-for="item in userList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="type" label="操作" min-width="90" align="center">
|
||||
|
@ -80,17 +81,15 @@
|
|||
<el-footer>
|
||||
<el-button type="primary" @click="submitForm">保存</el-button>
|
||||
<el-button @click="resetForm">取消</el-button>
|
||||
|
||||
</el-footer>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { index } from 'd3';
|
||||
|
||||
export default {
|
||||
emits: ["success", "closed"],
|
||||
props:{
|
||||
mtask: { type: String, default: '' },
|
||||
date: { type: String, default: '' },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -101,52 +100,74 @@ import { index } from 'd3';
|
|||
edit: "编辑记录",
|
||||
show: "查看记录",
|
||||
},
|
||||
form:{},
|
||||
obj:{},
|
||||
form:{batch:''},
|
||||
addTemplate: {
|
||||
process: '',
|
||||
processName: '',
|
||||
batch: '',
|
||||
mgroup_name: '',
|
||||
count_use:1,
|
||||
count_ok: 1,
|
||||
count_no1: 1,
|
||||
count_no2: 1,
|
||||
count_no3: 1,
|
||||
count_notok: 1,
|
||||
count_notok1: 1,
|
||||
count_notok2: 1,
|
||||
count_notok3: 1,
|
||||
handle_user:'',
|
||||
user_name:'',
|
||||
handle_date:'',
|
||||
mtask:'',
|
||||
change:true
|
||||
},
|
||||
handleDate:'',
|
||||
related:[],
|
||||
userList:[],
|
||||
formList: [],
|
||||
material:'',
|
||||
recordId:'',
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
setFiltersVisible: false,
|
||||
options: [],
|
||||
materialOptions:[],
|
||||
rules: {
|
||||
batch: [{required: true, message: "请选选择批次", trigger: "blur"}]
|
||||
},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
console.log('date',this.date)
|
||||
this.getBatchs();
|
||||
this.getFormList();
|
||||
this.getUserList();
|
||||
},
|
||||
methods: {
|
||||
//显示
|
||||
open(mode = "add") {
|
||||
this.mode = mode;
|
||||
this.visible = true;
|
||||
return this;
|
||||
},
|
||||
getUserList(){
|
||||
let that = this;
|
||||
this.$API.system.user.list.req({belong_dept:'3423857962907983872',page:0}).then(res=>{
|
||||
that.userList = res;
|
||||
});
|
||||
},
|
||||
getFormList(){
|
||||
this.$API.pm.mtask.related.req(this.mtask).then(res=>{
|
||||
// debugger;
|
||||
console.log('工序进度')
|
||||
console.log(res)
|
||||
this.related = res;
|
||||
res.forEach(item=>{
|
||||
let obj = {
|
||||
process: item.mgroup,
|
||||
processName: item.mgroup_name,
|
||||
count_use:1,
|
||||
count_ok: 1,
|
||||
count_no1: 0,
|
||||
count_no2: 0,
|
||||
count_no3: 0,
|
||||
handle_user:'',
|
||||
user_name:'',
|
||||
change:false
|
||||
}
|
||||
this.formList.push(obj)
|
||||
let obj = {
|
||||
mtask:item.id,
|
||||
batch: '',
|
||||
mgroup_name: item.mgroup_name,
|
||||
count_use:1,
|
||||
count_ok: 1,
|
||||
count_notok: 1,
|
||||
count_notok1: 1,
|
||||
count_notok2: 1,
|
||||
count_notok3: 1,
|
||||
handle_user:'',
|
||||
change:false
|
||||
}
|
||||
this.formList.push(obj)
|
||||
})
|
||||
})
|
||||
},
|
||||
|
@ -160,15 +181,16 @@ import { index } from 'd3';
|
|||
},
|
||||
pushRow(){
|
||||
let obj = {
|
||||
process: '',
|
||||
processName:"",
|
||||
batch: '',
|
||||
mgroup_name:"",
|
||||
count_use:1,
|
||||
count_ok: 1,
|
||||
count_no1: 1,
|
||||
count_no2: 1,
|
||||
count_no3: 1,
|
||||
count_notok: 1,
|
||||
count_notok1: 1,
|
||||
count_notok2: 1,
|
||||
count_notok3: 1,
|
||||
handle_user:'',
|
||||
user_name:'',
|
||||
mtask:'',
|
||||
change:true
|
||||
}
|
||||
this.formList.push(obj);
|
||||
|
@ -176,12 +198,7 @@ import { index } from 'd3';
|
|||
deleteRow(){
|
||||
this.$refs.table.deleteRow(0)
|
||||
},
|
||||
//显示
|
||||
open(mode = "add") {
|
||||
this.mode = mode;
|
||||
this.visible = true;
|
||||
return this;
|
||||
},
|
||||
|
||||
getList(){
|
||||
this.$API.mtm.material.list.req({page:0}).then(res=>{
|
||||
this.options = res;
|
||||
|
@ -193,21 +210,24 @@ import { index } from 'd3';
|
|||
console.log(data.listIndex);
|
||||
debugger;
|
||||
},
|
||||
//提交
|
||||
submit() {
|
||||
this.$refs.dialogForm.validate(async (valid) => {
|
||||
//保存
|
||||
submitForm() {
|
||||
this.$refs.saveDialog.validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.isSaveing = true;
|
||||
try {
|
||||
var res;
|
||||
for(let i=0;i<this.formList.length;i++){
|
||||
this.formList[i].batch = this.form.batch;
|
||||
this.formList[i].handle_date = this.date;
|
||||
}
|
||||
this.form.pu_plan = this.puPlan;
|
||||
if (this.mode == "add") {
|
||||
res = await this.$API.pum.planitem.create.req(this.form);
|
||||
res = await this.$API.wpm.mlog.create.req(this.formList);
|
||||
} else if (this.mode == "edit") {
|
||||
res = await this.$API.pum.planitem.update.req(this.form.id,this.form);
|
||||
res = await this.$API.wpm.mlog.update.req(this.recordId,this.formList);
|
||||
}
|
||||
this.isSaveing = false;
|
||||
this.$emit("success", this.form, this.mode);
|
||||
this.visible = false;
|
||||
this.$message.success("操作成功");
|
||||
} catch (err) {
|
||||
|
@ -220,7 +240,25 @@ import { index } from 'd3';
|
|||
},
|
||||
//表单注入数据
|
||||
setData(data) {
|
||||
Object.assign(this.form, data);
|
||||
console.log('data:',data)
|
||||
this.form.batch = data.batch;
|
||||
this.recordId = data.id;
|
||||
let obj = {};
|
||||
obj.batch = data.batch;
|
||||
obj.handle_date = data.handle_date;
|
||||
obj.mtask__mgroup__belong_dept__name = '6车间';
|
||||
this.$API.wpm.mlog.list.req(obj).then(res=>{
|
||||
let data = res.results;
|
||||
for(let i=0;i<this.formList.length;i++){
|
||||
data.forEach(item=>{
|
||||
if(item.mgroup_name==this.formList[i].mgroup_name){
|
||||
Object.assign(this.formList[i],item)
|
||||
}
|
||||
})
|
||||
}
|
||||
console.log('formList:',this.formList)
|
||||
console.log('data:',data)
|
||||
})
|
||||
},
|
||||
//设置过滤项
|
||||
setFilters(filters) {
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
<el-col :span="10" 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" icon="el-icon-plus" @click="add">任务下达</el-button>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery" >导出</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="10车间" name="first">
|
||||
|
@ -242,7 +242,8 @@ export default {
|
|||
save: false,
|
||||
},
|
||||
sumLog:false,
|
||||
apiObj: this.$API.pm.mtask.list,
|
||||
// apiObj: this.$API.pm.mtask.list,
|
||||
apiObj: null,
|
||||
query: {
|
||||
page:1,
|
||||
page_size:20,
|
||||
|
|
|
@ -1,6 +1,18 @@
|
|||
<template>
|
||||
<el-container style="flex-direction: column">
|
||||
<el-main id="topContainer" class="nopadding" style="position: relative;margin-bottom: 10px;">
|
||||
<div class="right-panel tabsHeader">
|
||||
<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-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
|
||||
<el-tab-pane label="粗加工6车间" name="first">
|
||||
<scTable
|
||||
|
@ -52,11 +64,12 @@
|
|||
<div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="13" style="border-right: 1px solid #eeeeee;">
|
||||
<div>工序进度</div>
|
||||
<div class="tableTitle">工序进度</div>
|
||||
<scTable
|
||||
ref="table"
|
||||
row-key="id"
|
||||
stripe
|
||||
:hideDo="hideDo"
|
||||
:data="processList"
|
||||
:height="bottomHeight"
|
||||
>
|
||||
|
@ -80,11 +93,12 @@
|
|||
</scTable>
|
||||
</el-col>
|
||||
<el-col :span="11">
|
||||
<div>车间物料</div>
|
||||
<div class="tableTitle">车间物料</div>
|
||||
<scTable
|
||||
ref="table"
|
||||
row-key="id"
|
||||
stripe
|
||||
:hideDo="hideDo"
|
||||
:data="wMaterial"
|
||||
:height="bottomHeight"
|
||||
>
|
||||
|
@ -142,6 +156,7 @@ export default {
|
|||
30: '在修',
|
||||
40: '禁用',
|
||||
},
|
||||
hideDo:true,
|
||||
topHeight:null,
|
||||
bottomHeight:null,
|
||||
};
|
||||
|
@ -150,8 +165,11 @@ export default {
|
|||
let heights = document.getElementById('topContainer').clientHeight;
|
||||
console.log('heights',heights)
|
||||
this.topHeight = (heights-50)+'px';
|
||||
this.bottomHeight = (heights-40)+'px';
|
||||
this.bottomHeight = (heights-50)+'px';
|
||||
this.getWorkSpaceMaterial();
|
||||
let NowDate = new Date();
|
||||
let month = NowDate.getMonth()>8?NowDate.getMonth()+1:'0'+(NowDate.getMonth()+1)
|
||||
this.query.date = NowDate.getFullYear()+'-'+(NowDate.getMonth()+1)+'-'+NowDate.getDate();
|
||||
},
|
||||
methods: {
|
||||
//车间物料
|
||||
|
@ -236,7 +254,21 @@ export default {
|
|||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.tabsHeader{
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
margin-top: 4px;
|
||||
z-index:100
|
||||
}
|
||||
.el-main.nopadding{
|
||||
padding:0 20px 0 20px
|
||||
}
|
||||
.tableTitle{
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
font-size: 14px;
|
||||
box-sizing: border-box;
|
||||
border-bottom: 1px solid #eeeeee;
|
||||
}
|
||||
</style>
|
|
@ -34,10 +34,11 @@
|
|||
:apiObj="apiObj"
|
||||
row-key="id"
|
||||
stripe
|
||||
:hidePagination="true"
|
||||
:params="query"
|
||||
>
|
||||
<el-table-column type="index" width="50"/>
|
||||
<el-table-column label="产品编号" prop="material">
|
||||
<el-table-column label="产品编号" prop="batch">
|
||||
</el-table-column>
|
||||
<el-table-column label="产品名称" prop="number">
|
||||
</el-table-column>
|
||||
|
@ -45,15 +46,15 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="规格" prop="number">
|
||||
</el-table-column>
|
||||
<el-table-column label="领料数量" prop="count">
|
||||
<el-table-column label="领料数量" prop="count_use">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="left" width="120">
|
||||
<el-table-column label="操作" fixed="right" align="center" width="100">
|
||||
<template #default="scope">
|
||||
<el-link
|
||||
type="primary"
|
||||
@click="table_edit(scope.row)"
|
||||
v-if="scope.row.status==10"
|
||||
v-auth="'equipment.update'"
|
||||
v-if="orderObj.state==10||orderObj.state==20"
|
||||
v-auth="'equipment'"
|
||||
>编辑
|
||||
</el-link>
|
||||
<!-- 提交后变查看 -->
|
||||
|
@ -61,11 +62,12 @@
|
|||
v-else
|
||||
type="primary"
|
||||
@click="table_edit(scope.row)"
|
||||
v-auth="'equipment.update'"
|
||||
v-auth="'equipment'"
|
||||
>查看
|
||||
</el-link>
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
<el-link
|
||||
type="primary"
|
||||
type="danger"
|
||||
@click="table_edit(scope.row)"
|
||||
>删除
|
||||
</el-link>
|
||||
|
@ -78,6 +80,7 @@
|
|||
v-if="dialog.save"
|
||||
ref="saveDialog"
|
||||
:mtask="orderObj.id"
|
||||
:date="orderObj.start_date"
|
||||
@success="handleSaveSuccess"
|
||||
@closed="dialog.save = false"
|
||||
></save-dialog>
|
||||
|
@ -96,17 +99,18 @@
|
|||
},
|
||||
task:'',
|
||||
orderObj:{},
|
||||
// apiObj: this.$API.wpm.mlog.list,
|
||||
apiObj: null,
|
||||
query: {
|
||||
page:1,
|
||||
page_size:20
|
||||
page:0,
|
||||
mtask:''
|
||||
},
|
||||
materialId:'',
|
||||
};
|
||||
},
|
||||
mounted(){
|
||||
this.mtask = this.$route.query.mtask;
|
||||
this.query.mtask = this.$route.query.mtask;
|
||||
this.apiObj = this.$API.wpm.mlog.relatedFirst;
|
||||
this.getTask();//获取任务详情
|
||||
},
|
||||
methods: {
|
||||
|
@ -166,6 +170,11 @@
|
|||
resetQuery() {
|
||||
this.query = {};
|
||||
},
|
||||
submitForm(){
|
||||
this.$API.pm.mtask.submitSameDay.req(this.orderObj.id).then(re=>{
|
||||
console.log(res)
|
||||
})
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue