ziyuan
This commit is contained in:
parent
8f829a1147
commit
33802c4aae
|
@ -55,3 +55,20 @@ export function updatesubproductionplan(id, data) {
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//子计划详情
|
||||||
|
|
||||||
|
export function getProgress(id) {
|
||||||
|
return request({
|
||||||
|
url: `/pm/subproduction_plan/${id}/progress/`,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//子计划下达
|
||||||
|
export function issuesubplan(id) {
|
||||||
|
return request({
|
||||||
|
url: `/pm/subproduction_plan/${id}/issue/`,
|
||||||
|
method: 'post',
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
|
@ -166,6 +166,28 @@ export const asyncRoutes = [
|
||||||
meta: { title: '生产作业管理', icon: 'example', perms: ['index_manage'] }
|
meta: { title: '生产作业管理', icon: 'example', perms: ['index_manage'] }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
}
|
||||||
|
,
|
||||||
|
{
|
||||||
|
path: '/wpm',
|
||||||
|
component: Layout,
|
||||||
|
redirect: '/wpm/worktask',
|
||||||
|
name: 'pm',
|
||||||
|
meta: { title: '车间生产', icon: 'example', perms: ['equipment_set'] },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'worktask',
|
||||||
|
name: 'worktask',
|
||||||
|
component: () => import('@/views/wpm/worktask'),
|
||||||
|
meta: { title: '车间任务', icon: 'example', perms: ['index_manage'] }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'testitem',
|
||||||
|
name: 'testitem',
|
||||||
|
component: () => import('@/views/wpm/testitem'),
|
||||||
|
meta: { title: '检测项目', icon: 'example', perms: ['index_manage'] }
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/em',
|
path: '/em',
|
||||||
|
|
|
@ -44,10 +44,31 @@
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
<el-table-column label="物料编号">
|
<el-table-column label="物料编号">
|
||||||
<template slot-scope="scope">{{ scope.row.number }}</template>
|
<template slot-scope="scope">
|
||||||
|
|
||||||
|
{{ scope.row.number }}
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="物料类别" :filters="[{ text: '成品', value: 1 }, { text: '半成品', value: 2 },{ text: '主要原料', value: 3 }, { text: '辅助原料', value: 4 }]"
|
<el-table-column label="物料类别" :filters="[{
|
||||||
|
value: 1,
|
||||||
|
text: '成品'
|
||||||
|
}, {
|
||||||
|
value: 2,
|
||||||
|
text: '半成品'
|
||||||
|
}, {
|
||||||
|
value: 3,
|
||||||
|
text: '主要原料'
|
||||||
|
}, {
|
||||||
|
value: 4,
|
||||||
|
text: '辅助原料'
|
||||||
|
}, {
|
||||||
|
value: 5,
|
||||||
|
text: '加工工具'
|
||||||
|
}, {
|
||||||
|
value: 6,
|
||||||
|
text: '辅助工具'
|
||||||
|
}]"
|
||||||
:filter-method="filterTag"
|
:filter-method="filterTag"
|
||||||
filter-placement="bottom-end">
|
filter-placement="bottom-end">
|
||||||
<template slot-scope="scope"> {{options_[scope.row.type]}}</template>
|
<template slot-scope="scope"> {{options_[scope.row.type]}}</template>
|
||||||
|
|
|
@ -158,23 +158,39 @@
|
||||||
v-el-height-adaptive-table="{bottomOffset: 50}"
|
v-el-height-adaptive-table="{bottomOffset: 50}"
|
||||||
|
|
||||||
>
|
>
|
||||||
|
<el-table-column type="index" width="50" />
|
||||||
<el-table-column type="index" width="50" />
|
|
||||||
<el-table-column label="字段类型">
|
|
||||||
<template slot-scope="scope">{{ options_[scope.row.field_type] }}</template>
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
<el-table-column label="字段名称">
|
<el-table-column label="字段名称">
|
||||||
<template slot-scope="scope">{{ scope.row.field_name }}</template>
|
<template slot-scope="scope">{{ scope.row.field_name }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="字段类型">
|
||||||
|
<template slot-scope="scope">{{ options_[scope.row.field_type] }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<el-table-column label="字段标识">
|
<el-table-column label="字段标识">
|
||||||
<template slot-scope="scope">{{ scope.row.field_key }}</template>
|
<template slot-scope="scope">{{ scope.row.field_key }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="上限值">
|
||||||
<el-table-column label="选项显示名">
|
<template slot-scope="scope">{{ scope.row.high_limit }}</template>
|
||||||
<template slot-scope="scope">{{ scope.row.field_choice }}</template>
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="上限规则">
|
||||||
|
<template slot-scope="scope">{{ highoptionss_[scope.row.high_rule] }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="下限值">
|
||||||
|
<template slot-scope="scope">{{ scope.row.low_limit }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="下限规则">
|
||||||
|
<template slot-scope="scope"> {{ lowoptionss_[scope.row.low_rule] }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="是否判定">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag v-if="scope.row.need_judge==true">是</el-tag>
|
||||||
|
<el-tag v-else>是</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
@ -200,7 +216,7 @@
|
||||||
|
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-dialog :visible.sync="dialogVisible1" :title="dialogType1 === 'edit' ? '编辑表格字段' : '新增表格字段'">
|
<el-dialog :visible.sync="dialogVisible1" :title="dialogType1 === 'edit' ? '编辑表格字段' : '新增表格字段'">
|
||||||
<el-form ref="Form" :model="field" label-width="80px" label-position="right">
|
<el-form ref="Form" :model="field" label-width="100px" label-position="right">
|
||||||
<el-form-item label="字段类型" prop="field_type">
|
<el-form-item label="字段类型" prop="field_type">
|
||||||
<el-select style="width: 100%" v-model="field.field_type" placeholder="请选择">
|
<el-select style="width: 100%" v-model="field.field_type" placeholder="请选择">
|
||||||
<el-option
|
<el-option
|
||||||
|
@ -231,6 +247,36 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="是否需要判定" prop="need_judge">
|
||||||
|
<el-switch v-model="field.need_judge"></el-switch>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="上限值" prop="high_limit">
|
||||||
|
<el-input-number v-model="field.high_limit" :precision="2" :min="0"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="上限规则" prop="high_rule">
|
||||||
|
<el-select style="width: 100%" v-model="field.high_rule" placeholder="请选择">
|
||||||
|
<el-option
|
||||||
|
v-for="item in highoptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="下限值" prop="low_limit">
|
||||||
|
<el-input-number v-model="field.low_limit" :precision="2" :min="0"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="下限规则" prop="low_rule">
|
||||||
|
<el-select style="width: 100%" v-model="field.low_rule" placeholder="请选择">
|
||||||
|
<el-option
|
||||||
|
v-for="item in lowoptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="排序" prop="sort">
|
<el-form-item label="排序" prop="sort">
|
||||||
<el-input-number v-model="field.sort" :min="1" placeholder="排序"></el-input-number>
|
<el-input-number v-model="field.sort" :min="1" placeholder="排序"></el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -278,6 +324,7 @@
|
||||||
upUrl: upUrl(),
|
upUrl: upUrl(),
|
||||||
fileList:[],
|
fileList:[],
|
||||||
listLoading: true,
|
listLoading: true,
|
||||||
|
need_judge:false,
|
||||||
dialogVisibles: false,
|
dialogVisibles: false,
|
||||||
dialogVisibleForm: false,
|
dialogVisibleForm: false,
|
||||||
dialogTypes: "new",
|
dialogTypes: "new",
|
||||||
|
@ -317,6 +364,20 @@
|
||||||
page: 1,
|
page: 1,
|
||||||
page_size: 20,
|
page_size: 20,
|
||||||
},
|
},
|
||||||
|
highoptions:[{ value: 1,
|
||||||
|
label: '<'},{ value: 2,
|
||||||
|
label: '<='}],
|
||||||
|
lowoptions:[{ value: 1,
|
||||||
|
label: '>'},{ value: 2,
|
||||||
|
label: '>='}],
|
||||||
|
highoptionss_:{
|
||||||
|
1: '<',
|
||||||
|
2: '<='
|
||||||
|
},
|
||||||
|
lowoptionss_:{
|
||||||
|
1: '>',
|
||||||
|
2: '>='
|
||||||
|
},
|
||||||
options_: {
|
options_: {
|
||||||
'string':'文本',
|
'string':'文本',
|
||||||
'int':'整数',
|
'int':'整数',
|
||||||
|
|
|
@ -283,6 +283,12 @@
|
||||||
<el-table-column label="单位消耗量">
|
<el-table-column label="单位消耗量">
|
||||||
<template slot-scope="scope">{{ scope.row.count }}</template>
|
<template slot-scope="scope">{{ scope.row.count }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="是否主产出">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag v-if="scope.row.is_main==true"> 是</el-tag>
|
||||||
|
<el-tag v-else>否</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -315,7 +321,7 @@
|
||||||
<el-form
|
<el-form
|
||||||
ref="Forms"
|
ref="Forms"
|
||||||
:model="outputmaterial"
|
:model="outputmaterial"
|
||||||
label-width="80px"
|
label-width="120px"
|
||||||
label-position="right"
|
label-position="right"
|
||||||
>
|
>
|
||||||
|
|
||||||
|
@ -334,6 +340,10 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="是否主产出" prop="is_main">
|
||||||
|
<el-switch v-model="outputmaterial.is_main"></el-switch>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="排序" prop="sort">
|
<el-form-item label="排序" prop="sort">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="outputmaterial.sort"
|
v-model="outputmaterial.sort"
|
||||||
|
@ -558,6 +568,7 @@ export default {
|
||||||
inputtableData:"",
|
inputtableData:"",
|
||||||
editorOption: {} ,
|
editorOption: {} ,
|
||||||
processOptions:[],
|
processOptions:[],
|
||||||
|
is_main:false,
|
||||||
techdoc: defaulttechdoc,
|
techdoc: defaulttechdoc,
|
||||||
subproducation:defaultsubproducation,
|
subproducation:defaultsubproducation,
|
||||||
inputmaterial: defaultinputmaterial,
|
inputmaterial: defaultinputmaterial,
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
fit
|
fit
|
||||||
stripe
|
stripe
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
max-height="400"
|
height="300"
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
|
|
||||||
|
@ -51,6 +51,7 @@
|
||||||
<el-table-column label="交付截止时间">
|
<el-table-column label="交付截止时间">
|
||||||
<template slot-scope="scope">{{ scope.row.order_.delivery_date }}</template>
|
<template slot-scope="scope">{{ scope.row.order_.delivery_date }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="是否生成子计划">
|
<el-table-column label="是否生成子计划">
|
||||||
<template slot-scope="scope" >
|
<template slot-scope="scope" >
|
||||||
<el-tag v-if="scope.row.is_planed==false">否</el-tag>
|
<el-tag v-if="scope.row.is_planed==false">否</el-tag>
|
||||||
|
@ -95,6 +96,7 @@
|
||||||
fit
|
fit
|
||||||
stripe
|
stripe
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
|
height="250"
|
||||||
|
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
|
@ -126,6 +128,7 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<el-table-column label="创建时间">
|
<el-table-column label="创建时间">
|
||||||
<template slot-scope="scope">{{ scope.row.create_time }}</template>
|
<template slot-scope="scope">{{ scope.row.create_time }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -235,6 +238,7 @@ export default {
|
||||||
number: [{ required: true, message: "请输入", trigger: "blur" }],
|
number: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {},
|
computed: {},
|
||||||
|
@ -301,6 +305,7 @@ export default {
|
||||||
await createsubplan(scope.row.id).then((res) => {
|
await createsubplan(scope.row.id).then((res) => {
|
||||||
if (res.code >= 200) {
|
if (res.code >= 200) {
|
||||||
this.$message.success("生成子计划成功!");
|
this.$message.success("生成子计划成功!");
|
||||||
|
this.getplanList()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
|
@ -26,6 +26,16 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="工序编号">
|
<el-table-column label="工序编号">
|
||||||
<template slot-scope="scope">{{ scope.row.process_.number }}</template>
|
<template slot-scope="scope">{{ scope.row.process_.number }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="子工序">
|
||||||
|
<template slot-scope="scope" v-if="scope.row.steps">
|
||||||
|
<el-tag v-for="item in scope.row.steps"
|
||||||
|
:key="item.number"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.number">{{item.name}}</el-tag>
|
||||||
|
|
||||||
|
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="开工时间">
|
<el-table-column label="开工时间">
|
||||||
<template slot-scope="scope">{{ scope.row.start_date }}</template>
|
<template slot-scope="scope">{{ scope.row.start_date }}</template>
|
||||||
|
@ -33,7 +43,9 @@
|
||||||
<el-table-column label="完工时间">
|
<el-table-column label="完工时间">
|
||||||
<template slot-scope="scope">{{ scope.row.end_date }}</template>
|
<template slot-scope="scope">{{ scope.row.end_date }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="下达状态">
|
||||||
|
<template slot-scope="scope">{{ state_[scope.row.state] }}</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="创建时间">
|
<el-table-column label="创建时间">
|
||||||
<template slot-scope="scope">{{ scope.row.create_time }}</template>
|
<template slot-scope="scope">{{ scope.row.create_time }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -43,11 +55,21 @@
|
||||||
width="100px"
|
width="100px"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
|
||||||
<el-link type="primary"
|
<el-link type="primary"
|
||||||
v-if="checkPermission(['warehouse_update'])"
|
v-if="checkPermission(['warehouse_update'])"
|
||||||
@click="handleclick(scope)"
|
@click="handleclick(scope)"
|
||||||
>编辑</el-link
|
>修改日期</el-link
|
||||||
|
>
|
||||||
|
<el-link type="primary"
|
||||||
|
v-if="scope.row.state==0"
|
||||||
|
@click="handleissuedclick(scope)"
|
||||||
|
>下达</el-link
|
||||||
|
>
|
||||||
|
|
||||||
|
<el-link type="primary"
|
||||||
|
v-if="checkPermission(['warehouse_update'])"
|
||||||
|
@click="handleselectclick(scope)"
|
||||||
|
>查看详情</el-link
|
||||||
>
|
>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
@ -99,10 +121,55 @@
|
||||||
<el-button type="primary" @click="confirm('Form')">确认</el-button>
|
<el-button type="primary" @click="confirm('Form')">确认</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<el-dialog
|
||||||
|
:visible.sync="dialogVisibles"
|
||||||
|
>
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
:data="progressList"
|
||||||
|
border
|
||||||
|
fit
|
||||||
|
stripe
|
||||||
|
style="width: 100%"
|
||||||
|
max-height="400"
|
||||||
|
>
|
||||||
|
<el-table-column type="index" width="50" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-table-column label="预计消耗/产出">
|
||||||
|
<template slot-scope="scope">{{ scope.row.count }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="实际消耗/产出">
|
||||||
|
<template slot-scope="scope">{{ scope.row.count_real }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="生产计划编号">
|
||||||
|
<template slot-scope="scope">{{ scope.row.subproduction_plan }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="物料名称">
|
||||||
|
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="物料编号">
|
||||||
|
<template slot-scope="scope">{{ scope.row.material_.number }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="物料型号">
|
||||||
|
<template slot-scope="scope">{{ scope.row.material_.specification }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="物料单位">
|
||||||
|
<template slot-scope="scope">{{ scope.row.material_.unit }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<div style="text-align: right">
|
||||||
|
<el-button type="danger" @click="dialogVisibles = false">取消</el-button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getsubproductionplanList,updatesubproductionplan } from "@/api/pm";
|
import { getsubproductionplanList,updatesubproductionplan,getProgress,issuesubplan } from "@/api/pm";
|
||||||
import checkPermission from "@/utils/permission";
|
import checkPermission from "@/utils/permission";
|
||||||
|
|
||||||
|
|
||||||
|
@ -123,14 +190,21 @@ export default {
|
||||||
page_size: 20,
|
page_size: 20,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
progressList:[],
|
||||||
listLoading: true,
|
listLoading: true,
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
|
dialogVisibles: false,
|
||||||
dialogType: "new",
|
dialogType: "new",
|
||||||
rule1: {
|
rule1: {
|
||||||
number: [{ required: true, message: "请输入", trigger: "blur" }],
|
number: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||||
|
|
||||||
},
|
},
|
||||||
|
state_:{
|
||||||
|
0:'制定中',
|
||||||
|
1:'已下达',
|
||||||
|
2:'已接受',
|
||||||
|
3:'生产中',
|
||||||
|
4:'已完成'}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {},
|
computed: {},
|
||||||
|
@ -163,6 +237,16 @@ export default {
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
handleselectclick(scope)
|
||||||
|
{
|
||||||
|
this.dialogVisibles = true;
|
||||||
|
getProgress(scope.row.id).then((res) => {
|
||||||
|
if (res.code >= 200) {
|
||||||
|
this.progressList = res.data;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
confirm()
|
confirm()
|
||||||
{
|
{
|
||||||
updatesubproductionplan(this.subproductionplan.id,this.subproductionplan).then((res) => {
|
updatesubproductionplan(this.subproductionplan.id,this.subproductionplan).then((res) => {
|
||||||
|
@ -172,9 +256,27 @@ export default {
|
||||||
this.$message.success("成功");
|
this.$message.success("成功");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
handleissuedclick(scope)
|
||||||
|
{
|
||||||
|
this.$confirm("确定下达子计划?", "提醒", {
|
||||||
|
confirmButtonText: "确认",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "error",
|
||||||
|
})
|
||||||
|
.then(async () => {
|
||||||
|
await issuesubplan(scope.row.id).then((res) => {
|
||||||
|
if (res.code >= 200) {
|
||||||
|
this.getspList();
|
||||||
|
this.$message.success("子计划已下达!");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,258 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-card>
|
||||||
|
<div>
|
||||||
|
<el-input
|
||||||
|
v-model="listQuery.search"
|
||||||
|
placeholder="项目名称"
|
||||||
|
style="width: 300px"
|
||||||
|
class="filter-item"
|
||||||
|
@keyup.enter.native="handleFilter"
|
||||||
|
/>
|
||||||
|
<el-button
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-search"
|
||||||
|
@click="handleFilter"
|
||||||
|
>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-refresh-left"
|
||||||
|
@click="resetFilter"
|
||||||
|
>重置</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<div style="margin-top: 10px">
|
||||||
|
<el-button type="primary" icon="el-icon-plus" @click="handleCreate"
|
||||||
|
>新增项目</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
<el-card style="margin-top: 10px">
|
||||||
|
<el-table
|
||||||
|
v-loading="listLoading"
|
||||||
|
:data="testitemList.results"
|
||||||
|
border
|
||||||
|
fit
|
||||||
|
stripe
|
||||||
|
highlight-current-row
|
||||||
|
max-height="600"
|
||||||
|
>
|
||||||
|
<el-table-column type="index" width="50" />
|
||||||
|
<el-table-column label="项目名称">
|
||||||
|
<template slot-scope="scope">{{ scope.row.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="条款号">
|
||||||
|
<template slot-scope="scope">{{ scope.row.term_number }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="标准名称">
|
||||||
|
<template slot-scope="scope">{{ scope.row.standard_.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="标准编号">
|
||||||
|
<template slot-scope="scope">{{ scope.row.standard_.number }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="创建时间">
|
||||||
|
<template slot-scope="scope">{{ scope.row.create_time }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="操作"
|
||||||
|
width="220px"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
|
||||||
|
<el-link
|
||||||
|
v-if="checkPermission(['warehouse_update'])"
|
||||||
|
@click="handleEdit(scope)"
|
||||||
|
>编辑</el-link
|
||||||
|
>
|
||||||
|
<el-link
|
||||||
|
v-if="checkPermission(['warehouse_delete'])"
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope)"
|
||||||
|
>删除</el-link
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination
|
||||||
|
v-show="testitemList.count > 0"
|
||||||
|
:total="testitemList.count"
|
||||||
|
:page.sync="listQuery.page"
|
||||||
|
:limit.sync="listQuery.page_size"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</el-card>
|
||||||
|
<el-dialog
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
:title="dialogType === 'edit' ? '编辑项目' : '新增项目'"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
ref="Form"
|
||||||
|
:model="testitem"
|
||||||
|
label-width="80px"
|
||||||
|
label-position="right"
|
||||||
|
:rules="rule1"
|
||||||
|
>
|
||||||
|
<el-form-item label="项目名称" prop="name">
|
||||||
|
<el-input v-model="testitem.name" placeholder="项目名称" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="条款号" prop="term_number">
|
||||||
|
<el-input v-model="testitem.term_number" placeholder="条款号" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="标准" prop="standard">
|
||||||
|
<el-select style="width: 100%" v-model="testitem.standard" placeholder="请选择">
|
||||||
|
<el-option
|
||||||
|
v-for="item in options"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
<div style="text-align: right">
|
||||||
|
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="confirm('Form')">确认</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { getTestitemList, createTestitem,updateTestitem,deleteTestitem,getStandardList } from "@/api/qm";
|
||||||
|
import checkPermission from "@/utils/permission";
|
||||||
|
|
||||||
|
|
||||||
|
import { genTree } from "@/utils";
|
||||||
|
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||||
|
const defaultetestitem = {
|
||||||
|
};
|
||||||
|
export default {
|
||||||
|
components: { Pagination },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
testitem: defaultetestitem,
|
||||||
|
testitemList: {
|
||||||
|
count: 0,
|
||||||
|
},
|
||||||
|
listQuery: {
|
||||||
|
page: 1,
|
||||||
|
page_size: 20,
|
||||||
|
},
|
||||||
|
options:[],
|
||||||
|
listLoading: true,
|
||||||
|
dialogVisible: false,
|
||||||
|
dialogType: "new",
|
||||||
|
rule1: {
|
||||||
|
name: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||||
|
term_number: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {},
|
||||||
|
watch: {},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
this.getLists()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
checkPermission,
|
||||||
|
//列表
|
||||||
|
getList() {
|
||||||
|
this.listLoading = true;
|
||||||
|
getTestitemList(this.listQuery).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.testitemList = response.data;
|
||||||
|
}
|
||||||
|
this.listLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
getLists() {
|
||||||
|
|
||||||
|
getStandardList({pageoff:true}).then((response) => {
|
||||||
|
|
||||||
|
this.options = genTree(response.data);
|
||||||
|
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
handleFilter() {
|
||||||
|
this.listQuery.page = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
resetFilter() {
|
||||||
|
this.listQuery = {
|
||||||
|
page: 1,
|
||||||
|
page_size: 20,
|
||||||
|
}
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
handleCreate() {
|
||||||
|
this.testitem = Object.assign({}, defaultetestitem);
|
||||||
|
this.dialogType = "new";
|
||||||
|
this.dialogVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs["Form"].clearValidate();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
handleEdit(scope) {
|
||||||
|
this.testitem = Object.assign({}, scope.row); // copy obj
|
||||||
|
this.dialogType = "edit";
|
||||||
|
this.dialogVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs["Form"].clearValidate();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleDelete(scope) {
|
||||||
|
this.$confirm("确认删除?", "警告", {
|
||||||
|
confirmButtonText: "确认",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "error",
|
||||||
|
})
|
||||||
|
.then(async () => {
|
||||||
|
await deleteTestitem(scope.row.id);
|
||||||
|
this.getList();
|
||||||
|
this.$message.success("成功");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
async confirm(form) {
|
||||||
|
this.$refs[form].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
const isEdit = this.dialogType === "edit";
|
||||||
|
if (isEdit) {
|
||||||
|
updateTestitem(this.testitem.id, this.testitem).then((res) => {
|
||||||
|
if (res.code >= 200) {
|
||||||
|
this.getList();
|
||||||
|
this.dialogVisible = false;
|
||||||
|
this.$message.success("成功");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
createTestitem(this.testitem).then((res) => {
|
||||||
|
if (res.code >= 200) {
|
||||||
|
this.getList();
|
||||||
|
this.dialogVisible = false;
|
||||||
|
this.$message.success("成功");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -0,0 +1,107 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-card class="box-card">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>生产任务列表</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
:data="subproductionplanList.results"
|
||||||
|
border
|
||||||
|
fit
|
||||||
|
stripe
|
||||||
|
style="width: 100%"
|
||||||
|
max-height="400"
|
||||||
|
>
|
||||||
|
<el-table-column type="index" width="50" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-table-column label="生产子计划名">
|
||||||
|
<template slot-scope="scope">{{ scope.row.workshop_.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="工序名">
|
||||||
|
<template slot-scope="scope">{{ scope.row.process_.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="工序编号">
|
||||||
|
<template slot-scope="scope">{{ scope.row.process_.number }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="子工序">
|
||||||
|
<template slot-scope="scope" v-if="scope.row.steps">
|
||||||
|
<el-tag v-for="item in scope.row.steps"
|
||||||
|
:key="item.number"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.number">{{item.name}}</el-tag>
|
||||||
|
|
||||||
|
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="开工时间">
|
||||||
|
<template slot-scope="scope">{{ scope.row.start_date }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="完工时间">
|
||||||
|
<template slot-scope="scope">{{ scope.row.end_date }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="创建时间">
|
||||||
|
<template slot-scope="scope">{{ scope.row.create_time }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
</el-table>
|
||||||
|
<pagination
|
||||||
|
v-show="subproductionplanList.count > 0"
|
||||||
|
:total="subproductionplanList.count"
|
||||||
|
:page.sync="listQuery.page"
|
||||||
|
:limit.sync="listQuery.page_size"
|
||||||
|
@pagination="getspList"
|
||||||
|
/>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { getsubproductionplanList } from "@/api/pm";
|
||||||
|
import checkPermission from "@/utils/permission";
|
||||||
|
|
||||||
|
|
||||||
|
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: { Pagination },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
|
||||||
|
subproductionplanList: {
|
||||||
|
count: 0,
|
||||||
|
},
|
||||||
|
listQuery: {
|
||||||
|
page: 1,
|
||||||
|
page_size: 20,
|
||||||
|
},
|
||||||
|
|
||||||
|
listLoading: true
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {},
|
||||||
|
watch: {},
|
||||||
|
created() {
|
||||||
|
this.getspList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
checkPermission,
|
||||||
|
//订单列表
|
||||||
|
getspList() {
|
||||||
|
this.listLoading = true;
|
||||||
|
console.log(this.listQuery)
|
||||||
|
getsubproductionplanList(this.listQuery).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.subproductionplanList = response.data;
|
||||||
|
}
|
||||||
|
this.listLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
</script>
|
Loading…
Reference in New Issue