chanpinguanli
This commit is contained in:
parent
bf375e000a
commit
19b684192a
|
@ -1,5 +1,6 @@
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
//物料
|
//物料
|
||||||
|
|
||||||
export function getMaterialList(query) {
|
export function getMaterialList(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/mtm/material/',
|
url: '/mtm/material/',
|
||||||
|
@ -34,6 +35,36 @@ export function deleteMaterial(id, data) {
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//产品分解
|
||||||
|
export function getsubproducationList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/mtm/subproducation/',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function createsubproducation(data) {
|
||||||
|
return request({
|
||||||
|
url: '/mtm/subproducation/',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updatesubproducation(id, data) {
|
||||||
|
return request({
|
||||||
|
url: `/mtm/subproducation/${id}/`,
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function deletesubproducation(id, data) {
|
||||||
|
return request({
|
||||||
|
url: `/mtm/subproducation/${id}/`,
|
||||||
|
method: 'delete',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
//工序
|
//工序
|
||||||
export function getProcessList(query) {
|
export function getProcessList(query) {
|
||||||
return request({
|
return request({
|
||||||
|
@ -64,7 +95,16 @@ export function deleteProcess(id, data) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//子工序
|
//子工序
|
||||||
export function getStepList(id) {
|
export function getStepList(query) {
|
||||||
|
return request({
|
||||||
|
url: `/mtm/step/`,
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function getStepLists(id) {
|
||||||
return request({
|
return request({
|
||||||
url: `/mtm/process/${id}/steps/`,
|
url: `/mtm/process/${id}/steps/`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
//生产排程
|
||||||
|
export function getProductionplanList(query) {
|
||||||
|
return request({
|
||||||
|
url: 'pm/productionplan/',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function createProductionplan(data) {
|
||||||
|
return request({
|
||||||
|
url: 'pm/productionplan/',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -87,3 +87,10 @@ export function deleteOrder(id, data) {
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getordertoplan() {
|
||||||
|
return request({
|
||||||
|
url: '/sam/order/toplan/',
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
}
|
|
@ -130,6 +130,34 @@ export const asyncRoutes = [
|
||||||
meta: { title: '产品管理', icon: 'example', perms: ['vendor_manage'] }
|
meta: { title: '产品管理', icon: 'example', perms: ['vendor_manage'] }
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
}
|
||||||
|
,
|
||||||
|
{
|
||||||
|
path: '/pm',
|
||||||
|
component: Layout,
|
||||||
|
redirect: '/pm/plan',
|
||||||
|
name: 'pm',
|
||||||
|
meta: { title: '生产管理', icon: 'example', perms: ['equipment_set'] },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'plan',
|
||||||
|
name: 'plan',
|
||||||
|
component: () => import('@/views/pm/plan'),
|
||||||
|
meta: { title: '生产计划管理', icon: 'example', perms: ['index_manage'] }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'resources',
|
||||||
|
name: 'resources',
|
||||||
|
component: () => import('@/views/pm/resources'),
|
||||||
|
meta: { title: '生产资源配置', icon: 'example', perms: ['index_manage'] }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'testitem',
|
||||||
|
name: 'testitem',
|
||||||
|
component: () => import('@/views/pm/plan'),
|
||||||
|
meta: { title: '生产作业管理', icon: 'example', perms: ['index_manage'] }
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/em',
|
path: '/em',
|
||||||
|
@ -233,6 +261,13 @@ export const asyncRoutes = [
|
||||||
name: 'warehouse',
|
name: 'warehouse',
|
||||||
component: () => import('@/views/inm/warehouse'),
|
component: () => import('@/views/inm/warehouse'),
|
||||||
meta: { title: '仓库', icon: 'example', perms: ['index_manage'] }
|
meta: { title: '仓库', icon: 'example', perms: ['index_manage'] }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'materialbatch/:id',
|
||||||
|
name: 'MaterialBatch',
|
||||||
|
component: () => import('@/views/inm/materialbatch'),
|
||||||
|
meta: { title: '仓库物料', perms: ['vendor_manage'] },
|
||||||
|
hidden: true
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
{
|
{
|
||||||
|
|
|
@ -0,0 +1,178 @@
|
||||||
|
<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>
|
||||||
|
</el-card>
|
||||||
|
<el-card style="margin-top: 10px">
|
||||||
|
<el-table
|
||||||
|
v-loading="listLoading"
|
||||||
|
:data="warehouseList.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.number }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="入库数量">
|
||||||
|
<template slot-scope="scope">{{ scope.row.place }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="物料有效期">
|
||||||
|
<template slot-scope="scope">{{ scope.row.place }}</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_delete'])"
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope)"
|
||||||
|
>删除</el-link
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination
|
||||||
|
v-show="warehouseList.count > 0"
|
||||||
|
:total="warehouseList.count"
|
||||||
|
:page.sync="listQuery.page"
|
||||||
|
:limit.sync="listQuery.page_size"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { getWarehouseList, deleteWarehouse } from "@/api/inm";
|
||||||
|
import checkPermission from "@/utils/permission";
|
||||||
|
|
||||||
|
|
||||||
|
import { genTree } from "@/utils";
|
||||||
|
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||||
|
const defaultewarehouse = {
|
||||||
|
};
|
||||||
|
export default {
|
||||||
|
components: { Pagination },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
warehouse: defaultewarehouse,
|
||||||
|
warehouseList: {
|
||||||
|
count: 0,
|
||||||
|
},
|
||||||
|
options: [{
|
||||||
|
value: 0,
|
||||||
|
label: '运转正常'
|
||||||
|
}, {
|
||||||
|
value: 1,
|
||||||
|
label: '停用'
|
||||||
|
}, {
|
||||||
|
value: 2,
|
||||||
|
label: '报废'
|
||||||
|
}],
|
||||||
|
listQuery: {
|
||||||
|
page: 1,
|
||||||
|
page_size: 20,
|
||||||
|
},
|
||||||
|
keeperOptions:[],
|
||||||
|
depOptions:[],
|
||||||
|
listLoading: true,
|
||||||
|
dialogVisible: false,
|
||||||
|
dialogType: "new",
|
||||||
|
rule1: {
|
||||||
|
name: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||||
|
number: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||||
|
place: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {},
|
||||||
|
watch: {},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
checkPermission,
|
||||||
|
//设备列表
|
||||||
|
getList() {
|
||||||
|
this.listLoading = true;
|
||||||
|
getWarehouseList(this.listQuery).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.warehouseList = response.data;
|
||||||
|
}
|
||||||
|
this.listLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
handleMaterial(scope){
|
||||||
|
alert(1)
|
||||||
|
},
|
||||||
|
handleFilter() {
|
||||||
|
this.listQuery.page = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
resetFilter() {
|
||||||
|
this.listQuery = {
|
||||||
|
page: 1,
|
||||||
|
page_size: 20,
|
||||||
|
}
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
|
||||||
|
handleDelete(scope) {
|
||||||
|
this.$confirm("确认删除?", "警告", {
|
||||||
|
confirmButtonText: "确认",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "error",
|
||||||
|
})
|
||||||
|
.then(async () => {
|
||||||
|
await deleteWarehouse(scope.row.id);
|
||||||
|
this.getList();
|
||||||
|
this.$message.success("成功");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -177,9 +177,9 @@ export default {
|
||||||
this.listLoading = false;
|
this.listLoading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
//跳转到该仓库的物料表
|
||||||
handleMaterial(scope){
|
handleMaterial(scope){
|
||||||
alert(1)
|
this.$router.push({name: "MaterialBatch", params: { id: scope.row.id }, })
|
||||||
},
|
},
|
||||||
handleFilter() {
|
handleFilter() {
|
||||||
this.listQuery.page = 1;
|
this.listQuery.page = 1;
|
||||||
|
|
|
@ -61,16 +61,7 @@
|
||||||
<el-form-item label="表格名称" prop="name">
|
<el-form-item label="表格名称" prop="name">
|
||||||
<el-input v-model="recordform.name" placeholder="表格名称" />
|
<el-input v-model="recordform.name" placeholder="表格名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="表格类型" prop="type">
|
|
||||||
<el-select style="width: 100%" v-model="recordform.type" placeholder="请选择">
|
|
||||||
<el-option
|
|
||||||
v-for="item in typeoptions"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,7 @@
|
||||||
fit
|
fit
|
||||||
stripe
|
stripe
|
||||||
highlight-current-row
|
highlight-current-row
|
||||||
height="100"
|
|
||||||
v-el-height-adaptive-table="{bottomOffset: 50}"
|
|
||||||
@current-change="handleCurrentChange">
|
@current-change="handleCurrentChange">
|
||||||
|
|
||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
|
@ -30,9 +29,6 @@
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="18" >
|
|
||||||
<el-card >
|
<el-card >
|
||||||
|
|
||||||
<el-descriptions class="margin-top" title="产品信息" :column="3" border>
|
<el-descriptions class="margin-top" title="产品信息" :column="3" border>
|
||||||
|
@ -56,7 +52,9 @@
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
|
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-card class="box-card">
|
</el-col>
|
||||||
|
<el-col :span="18" >
|
||||||
|
<el-card class="box-card">
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<span style="font-size: 16px;
|
<span style="font-size: 16px;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
|
@ -68,6 +66,87 @@
|
||||||
</el-step>
|
</el-step>
|
||||||
</el-steps>
|
</el-steps>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
<el-card class="box-card">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span style="font-size: 16px;
|
||||||
|
font-weight: 700;
|
||||||
|
">生产分解</span>
|
||||||
|
</div>
|
||||||
|
<el-button type="primary" icon="el-icon-plus" @click="handlesubproducationCreate"
|
||||||
|
>新增</el-button>
|
||||||
|
<el-table
|
||||||
|
|
||||||
|
:data="subproducationData"
|
||||||
|
border
|
||||||
|
fit
|
||||||
|
stripe
|
||||||
|
@current-change="handlespChange"
|
||||||
|
>
|
||||||
|
<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.sort }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="操作"
|
||||||
|
width="220px"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
|
||||||
|
<el-link
|
||||||
|
v-if="checkPermission(['material_update'])"
|
||||||
|
@click="handlesubproducationEdit(scope)"
|
||||||
|
>编辑</el-link
|
||||||
|
>
|
||||||
|
<el-link
|
||||||
|
v-if="checkPermission(['material_delete'])"
|
||||||
|
type="danger"
|
||||||
|
@click="handlesubproducationDelete(scope)"
|
||||||
|
>删除</el-link
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<el-dialog
|
||||||
|
:visible.sync="dialogVisiblesp"
|
||||||
|
:title="dialogTypesp === 'edit' ? '编辑生产分解' : '新增生产分解'"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
ref="Formsp"
|
||||||
|
:model="subproducation"
|
||||||
|
label-width="80px"
|
||||||
|
label-position="right"
|
||||||
|
>
|
||||||
|
|
||||||
|
<el-form-item label="名称" prop="name">
|
||||||
|
<el-input v-model="subproducation.name" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="排序" prop="sort">
|
||||||
|
<el-input-number
|
||||||
|
v-model="subproducation.sort"
|
||||||
|
:min="-2147483648"
|
||||||
|
:max="2147483647"
|
||||||
|
></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
<div style="text-align: right">
|
||||||
|
<el-button type="danger" @click="dialogVisible1 = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="subproducationfirm('Formsp')">确认</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
|
||||||
<el-tabs type="border-card">
|
<el-tabs type="border-card">
|
||||||
<el-tab-pane label="输入物料">
|
<el-tab-pane label="输入物料">
|
||||||
|
@ -272,7 +351,9 @@
|
||||||
<el-table-column label="子工序名称">
|
<el-table-column label="子工序名称">
|
||||||
<template slot-scope="scope">{{ scope.row.step_.name }}</template>
|
<template slot-scope="scope">{{ scope.row.step_.name }}</template>
|
||||||
</el-table-column >
|
</el-table-column >
|
||||||
|
<el-table-column label="备注">
|
||||||
|
<template slot-scope="scope">{{ scope.row.remark }}</template>
|
||||||
|
</el-table-column >
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
align="center"
|
align="center"
|
||||||
|
@ -318,7 +399,9 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="usedstep.remark" placeholder="输入备注信息" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
<div style="text-align: right">
|
<div style="text-align: right">
|
||||||
|
@ -327,10 +410,7 @@
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="检验要求">
|
|
||||||
<el-button type="primary" icon="el-icon-plus"
|
|
||||||
>新增</el-button>
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane label="技术文件">
|
<el-tab-pane label="技术文件">
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="handletechdocCreate"
|
<el-button type="primary" icon="el-icon-plus" @click="handletechdocCreate"
|
||||||
>新增</el-button>
|
>新增</el-button>
|
||||||
|
@ -426,7 +506,8 @@
|
||||||
<script>
|
<script>
|
||||||
import { getMaterialList,getMaterial,getInputmaterialList,createInputmaterial,updateInputmaterial
|
import { getMaterialList,getMaterial,getInputmaterialList,createInputmaterial,updateInputmaterial
|
||||||
,deleteInputmaterial,getOutputmaterialList,createOutputmaterial,updateOutputmaterial,deleteOutputmaterial,
|
,deleteInputmaterial,getOutputmaterialList,createOutputmaterial,updateOutputmaterial,deleteOutputmaterial,
|
||||||
getUsedstepList,createUsedstep,deleteUsedstep,getStepList,gettechdocList,createtechdoc,updatetechdoc,deletetechdoc } from "@/api/mtm";
|
getUsedstepList,createUsedstep,deleteUsedstep,getStepList,gettechdocList,createtechdoc,updatetechdoc,deletetechdoc
|
||||||
|
,getsubproducationList,createsubproducation,updatesubproducation,deletesubproducation } from "@/api/mtm";
|
||||||
import { quillEditor } from 'vue-quill-editor'
|
import { quillEditor } from 'vue-quill-editor'
|
||||||
import 'quill/dist/quill.core.css'
|
import 'quill/dist/quill.core.css'
|
||||||
import 'quill/dist/quill.snow.css'
|
import 'quill/dist/quill.snow.css'
|
||||||
|
@ -446,6 +527,9 @@ const defaultusedstep = {
|
||||||
};
|
};
|
||||||
const defaulttechdoc = {
|
const defaulttechdoc = {
|
||||||
|
|
||||||
|
};
|
||||||
|
const defaultsubproducation = {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -454,9 +538,11 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
materialoptions:[],
|
materialoptions:[],
|
||||||
|
subproducationData:"",
|
||||||
inputtableData:"",
|
inputtableData:"",
|
||||||
editorOption: {} ,
|
editorOption: {} ,
|
||||||
techdoc: defaulttechdoc,
|
techdoc: defaulttechdoc,
|
||||||
|
subproducation:defaultsubproducation,
|
||||||
inputmaterial: defaultinputmaterial,
|
inputmaterial: defaultinputmaterial,
|
||||||
techdoctableData:"",
|
techdoctableData:"",
|
||||||
outputtableData:"",
|
outputtableData:"",
|
||||||
|
@ -475,6 +561,9 @@ export default {
|
||||||
page: 1,
|
page: 1,
|
||||||
page_size: 20,
|
page_size: 20,
|
||||||
},
|
},
|
||||||
|
listQuerysubproducation: {
|
||||||
|
page: 0,
|
||||||
|
},
|
||||||
listQueryinput: {
|
listQueryinput: {
|
||||||
page: 0,
|
page: 0,
|
||||||
},
|
},
|
||||||
|
@ -487,10 +576,15 @@ export default {
|
||||||
listQuerytechdoc:{
|
listQuerytechdoc:{
|
||||||
page: 0,
|
page: 0,
|
||||||
},
|
},
|
||||||
|
listQuerystep:{
|
||||||
|
page: 0,
|
||||||
|
},
|
||||||
values:7,
|
values:7,
|
||||||
products:"",
|
products:"",
|
||||||
dialogType: "new",
|
dialogType: "new",
|
||||||
dialogVisible:false,
|
dialogVisible:false,
|
||||||
|
dialogTypesp: "new",
|
||||||
|
dialogVisiblesp:false,
|
||||||
dialogType1: "new",
|
dialogType1: "new",
|
||||||
dialogVisible1:false,
|
dialogVisible1:false,
|
||||||
dialogTypeusedstep: "new",
|
dialogTypeusedstep: "new",
|
||||||
|
@ -545,8 +639,19 @@ export default {
|
||||||
handleCurrentChange(row){
|
handleCurrentChange(row){
|
||||||
this.product=row.id;
|
this.product=row.id;
|
||||||
this.getMaterial();
|
this.getMaterial();
|
||||||
|
this.getsubproducationList();
|
||||||
},
|
},
|
||||||
|
//点击产品分解弹出输入、输出物料,子工序,技术文件
|
||||||
|
handlespChange(row){
|
||||||
|
this.subproduction = row.id;
|
||||||
|
this.getmaterialList();//物料列表
|
||||||
|
this.getInputmaterialLists();//输入物料
|
||||||
|
|
||||||
|
this.getOutputmaterialLists();//输出物料
|
||||||
|
this.getstepList();//子工序
|
||||||
|
this. getUsedstepLists();//
|
||||||
|
this.gettechdocLists();//技术文件
|
||||||
|
},
|
||||||
//工艺点击信息
|
//工艺点击信息
|
||||||
|
|
||||||
stepclick(id)
|
stepclick(id)
|
||||||
|
@ -563,15 +668,84 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
//产品分解
|
||||||
|
getsubproducationList(){
|
||||||
|
|
||||||
|
this.listQuerysubproducation.product=this.product
|
||||||
|
getsubproducationList(this.listQuerysubproducation).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
|
||||||
|
this.subproducationData = response.data;//产品信息
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handlesubproducationCreate()
|
||||||
|
{
|
||||||
|
this.subproducation = Object.assign({}, defaultsubproducation);
|
||||||
|
this.dialogTypesp = "new";
|
||||||
|
this.dialogVisiblesp = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs["Formsp"].clearValidate();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handlesubproducationEdit(scope) {
|
||||||
|
this.subproducation = Object.assign({}, scope.row); // copy obj
|
||||||
|
this.dialogTypesp = "edit";
|
||||||
|
this.dialogVisiblesp = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs["Formsp"].clearValidate();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handlesubproducationDelete(scope) {
|
||||||
|
this.$confirm("确认删除?", "警告", {
|
||||||
|
confirmButtonText: "确认",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "error",
|
||||||
|
})
|
||||||
|
.then(async () => {
|
||||||
|
await deletesubproducation(scope.row.id);
|
||||||
|
this.getsubproducationList()
|
||||||
|
this.$message.success("成功");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
async subproducationfirm(form) {
|
||||||
|
this.$refs[form].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
const isEdit = this.dialogTypesp === "edit";
|
||||||
|
if (isEdit) {
|
||||||
|
this.subproducation.product=this.product;
|
||||||
|
updatesubproducation(this.subproducation.id, this.subproducation).then((res) => {
|
||||||
|
if (res.code >= 200) {
|
||||||
|
this.getsubproducationList()
|
||||||
|
this.dialogVisiblesp = false;
|
||||||
|
this.$message.success("成功");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.subproducation.product=this.product;
|
||||||
|
createsubproducation(this.subproducation).then((res) => {
|
||||||
|
if (res.code >= 200) {
|
||||||
|
this.getsubproducationList()
|
||||||
|
this.dialogVisiblesp = false;
|
||||||
|
this.$message.success("成功");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
//输入物料列表
|
//输入物料列表
|
||||||
|
|
||||||
getInputmaterialLists(){
|
getInputmaterialLists(){
|
||||||
|
|
||||||
this.listQueryinput.process=this.process;
|
this.listQueryinput.subproduction=this.subproduction;
|
||||||
this.listQueryinput.product=this.product
|
|
||||||
getInputmaterialList(this.listQueryinput).then((response) => {
|
getInputmaterialList(this.listQueryinput).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
|
|
||||||
|
@ -617,8 +791,7 @@ export default {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const isEdit = this.dialogType === "edit";
|
const isEdit = this.dialogType === "edit";
|
||||||
if (isEdit) {
|
if (isEdit) {
|
||||||
this.inputmaterial.process=this.process;
|
this.inputmaterial.subproduction=this.subproduction;
|
||||||
this.inputmaterial.product=this.product;
|
|
||||||
updateInputmaterial(this.inputmaterial.id, this.inputmaterial).then((res) => {
|
updateInputmaterial(this.inputmaterial.id, this.inputmaterial).then((res) => {
|
||||||
if (res.code >= 200) {
|
if (res.code >= 200) {
|
||||||
this.getInputmaterialLists()
|
this.getInputmaterialLists()
|
||||||
|
@ -627,8 +800,7 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.inputmaterial.process=this.process;
|
this.inputmaterial.subproduction=this.subproduction;
|
||||||
this.inputmaterial.product=this.product;
|
|
||||||
createInputmaterial(this.inputmaterial).then((res) => {
|
createInputmaterial(this.inputmaterial).then((res) => {
|
||||||
if (res.code >= 200) {
|
if (res.code >= 200) {
|
||||||
this.getInputmaterialLists()
|
this.getInputmaterialLists()
|
||||||
|
@ -650,8 +822,7 @@ export default {
|
||||||
|
|
||||||
getOutputmaterialLists(){
|
getOutputmaterialLists(){
|
||||||
|
|
||||||
this.listQueryoutput.process=this.process;
|
this.listQueryoutput.subproduction=this.subproduction;
|
||||||
this.listQueryoutput.product=this.product
|
|
||||||
// this.listQueryoutput.page=0;
|
// this.listQueryoutput.page=0;
|
||||||
getOutputmaterialList(this.listQueryoutput).then((response) => {
|
getOutputmaterialList(this.listQueryoutput).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
|
@ -700,8 +871,7 @@ export default {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const isEdit = this.dialogType1 === "edit";
|
const isEdit = this.dialogType1 === "edit";
|
||||||
if (isEdit) {
|
if (isEdit) {
|
||||||
this.outputmaterial.process=this.process;
|
this.outputmaterial.subproduction=this.subproduction;
|
||||||
this.outputmaterial.product=this.product;
|
|
||||||
updateOutputmaterial(this.outputmaterial.id, this.outputmaterial).then((res) => {
|
updateOutputmaterial(this.outputmaterial.id, this.outputmaterial).then((res) => {
|
||||||
if (res.code >= 200) {
|
if (res.code >= 200) {
|
||||||
this.getOutputmaterialLists()
|
this.getOutputmaterialLists()
|
||||||
|
@ -710,8 +880,7 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.outputmaterial.process=this.process;
|
this.outputmaterial.subproduction=this.subproduction;
|
||||||
this.outputmaterial.product=this.product;
|
|
||||||
console.log(this.outputmaterial);
|
console.log(this.outputmaterial);
|
||||||
createOutputmaterial(this.outputmaterial).then((res) => {
|
createOutputmaterial(this.outputmaterial).then((res) => {
|
||||||
if (res.code >= 200) {
|
if (res.code >= 200) {
|
||||||
|
@ -730,8 +899,7 @@ export default {
|
||||||
|
|
||||||
getUsedstepLists(){
|
getUsedstepLists(){
|
||||||
|
|
||||||
this.listQueryusedstep.process=this.process;
|
this.listQueryusedstep.subproduction=this.subproduction;
|
||||||
this.listQueryusedstep.product=this.product
|
|
||||||
// this.listQueryusedstep.page=0;
|
// this.listQueryusedstep.page=0;
|
||||||
getUsedstepList(this.listQueryusedstep).then((response) => {
|
getUsedstepList(this.listQueryusedstep).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
|
@ -744,7 +912,7 @@ export default {
|
||||||
|
|
||||||
getstepList() {
|
getstepList() {
|
||||||
|
|
||||||
getStepList(this.process).then((response) => {
|
getStepList(this.listQuerystep).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.stepoptions = genTree(response.data);
|
this.stepoptions = genTree(response.data);
|
||||||
}
|
}
|
||||||
|
@ -794,12 +962,12 @@ export default {
|
||||||
},
|
},
|
||||||
async usedstepconfirm(form) {
|
async usedstepconfirm(form) {
|
||||||
|
|
||||||
this.usedstep.process=this.process;
|
this.usedstep.subproduction=this.subproduction;
|
||||||
this.usedstep.product=this.product;
|
|
||||||
console.log(this.usedstep);
|
console.log(this.usedstep);
|
||||||
createUsedstep(this.usedstep).then((res) => {
|
createUsedstep(this.usedstep).then((res) => {
|
||||||
if (res.code >= 200) {
|
if (res.code >= 200) {
|
||||||
this.getUsedstepLists()
|
this.getUsedstepLists();
|
||||||
|
this.getMaterial();
|
||||||
this.dialogVisibleusedstep = false;
|
this.dialogVisibleusedstep = false;
|
||||||
this.$message.success("成功");
|
this.$message.success("成功");
|
||||||
}
|
}
|
||||||
|
@ -807,8 +975,7 @@ export default {
|
||||||
},
|
},
|
||||||
//技术文件
|
//技术文件
|
||||||
gettechdocLists(){
|
gettechdocLists(){
|
||||||
this.listQuerytechdoc.process=this.process;
|
this.listQuerytechdoc.subproduction=this.subproduction;
|
||||||
this.listQuerytechdoc.product=this.product;
|
|
||||||
// this.listQuerytechdoc.page=0;
|
// this.listQuerytechdoc.page=0;
|
||||||
gettechdocList(this.listQuerytechdoc).then((response) => {
|
gettechdocList(this.listQuerytechdoc).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
|
@ -887,8 +1054,7 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.techdoc.process=this.process;
|
this.techdoc.subproduction=this.subproduction;
|
||||||
this.techdoc.product=this.product;
|
|
||||||
createtechdoc(this.techdoc).then((res) => {
|
createtechdoc(this.techdoc).then((res) => {
|
||||||
if (res.code >= 200) {
|
if (res.code >= 200) {
|
||||||
this.gettechdocLists();
|
this.gettechdocLists();
|
||||||
|
|
|
@ -356,7 +356,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getStepList, createStep,updateStep,deleteStep } from "@/api/mtm";
|
import { getStepLists, createStep,updateStep,deleteStep } from "@/api/mtm";
|
||||||
import checkPermission from "@/utils/permission";
|
import checkPermission from "@/utils/permission";
|
||||||
import { getEquipmentAll } from "@/api/equipment";
|
import { getEquipmentAll } from "@/api/equipment";
|
||||||
import { upUrl, upHeaders } from "@/api/file";
|
import { upUrl, upHeaders } from "@/api/file";
|
||||||
|
@ -502,7 +502,7 @@
|
||||||
//子工序列表
|
//子工序列表
|
||||||
getList() {
|
getList() {
|
||||||
this.listLoading = true;
|
this.listLoading = true;
|
||||||
getStepList(this.step.process).then((response) => {
|
getStepLists(this.step.process).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.stepList = response.data;
|
this.stepList = response.data;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,288 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-card class="box-card">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>生产任务列表</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
:data="productionplanList.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.number }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="生产订单编号">
|
||||||
|
<template slot-scope="scope">{{ scope.row.order_.number }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="合同编号">
|
||||||
|
<template slot-scope="scope">{{ scope.row.order_.contract_.number }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="客户名称">
|
||||||
|
<template slot-scope="scope">{{ scope.row.order_.customer_.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="产品信息">
|
||||||
|
<template slot-scope="scope">{{ scope.row.product_.number }}-{{ scope.row.product_.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="产品型号">
|
||||||
|
<template slot-scope="scope">{{ scope.row.product_.specification }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="产品单位">
|
||||||
|
<template slot-scope="scope">{{ scope.row.product_.unit }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<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.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.order_.delivery_date }}</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="100px"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
|
||||||
|
<el-link type="primary"
|
||||||
|
v-if="checkPermission(['warehouse_update'])"
|
||||||
|
@click="handleclick(scope)"
|
||||||
|
>车间排产</el-link
|
||||||
|
>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination
|
||||||
|
v-show="productionplanList.count > 0"
|
||||||
|
:total="productionplanList.count"
|
||||||
|
:page.sync="listQuery1.page"
|
||||||
|
:limit.sync="listQuery1.page_size"
|
||||||
|
@pagination="getplanList"
|
||||||
|
/>
|
||||||
|
</el-card>
|
||||||
|
<el-tabs type="border-card">
|
||||||
|
<el-tab-pane label="订单排产">
|
||||||
|
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
:data="orderList.results"
|
||||||
|
border
|
||||||
|
fit
|
||||||
|
stripe
|
||||||
|
style="width: 100%"
|
||||||
|
|
||||||
|
>
|
||||||
|
<el-table-column type="index" width="50" />
|
||||||
|
|
||||||
|
<el-table-column label="订单编号">
|
||||||
|
<template slot-scope="scope">{{ scope.row.number }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="客户">
|
||||||
|
<template slot-scope="scope">{{ scope.row.customer_.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="所属合同">
|
||||||
|
<template slot-scope="scope">{{ scope.row.contract_.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="所需产品">
|
||||||
|
<template slot-scope="scope">{{ scope.row.product_.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="产品型号">
|
||||||
|
<template slot-scope="scope">{{ scope.row.product_.specification }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<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.planed_count }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="交货日期">
|
||||||
|
<template slot-scope="scope">{{ scope.row.delivery_date }}</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 type="primary"
|
||||||
|
v-if="checkPermission(['warehouse_update'])"
|
||||||
|
@click="handleclick(scope)"
|
||||||
|
>排产</el-link
|
||||||
|
>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination
|
||||||
|
v-show="orderList.count > 0"
|
||||||
|
:total="orderList.count"
|
||||||
|
:page.sync="listQuery.page"
|
||||||
|
:limit.sync="listQuery.page_size"
|
||||||
|
@pagination="getorderList"
|
||||||
|
/>
|
||||||
|
<el-dialog
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
:title="'排产计划'"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
ref="Form"
|
||||||
|
:model="orderplan"
|
||||||
|
label-width="120px"
|
||||||
|
label-position="right"
|
||||||
|
:rules="rule1"
|
||||||
|
>
|
||||||
|
<el-form-item label="生产计划编号" prop="number">
|
||||||
|
<el-input v-model="orderplan.number" placeholder="生产计划编号" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="排产数量" prop="count">
|
||||||
|
<el-input type="number" v-model.number="orderplan.count"/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
<el-form-item label="计划排产时间" prop="value1">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="value1"
|
||||||
|
type="daterange"
|
||||||
|
|
||||||
|
start-placeholder="计划开始日期"
|
||||||
|
end-placeholder="计划结束日期"
|
||||||
|
format="yyyy 年 MM 月 dd 日"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</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>
|
||||||
|
</el-tab-pane>
|
||||||
|
|
||||||
|
<el-tab-pane label="甘特图">甘特图</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { getordertoplan } from "@/api/sam";
|
||||||
|
import { createProductionplan,getProductionplanList} from "@/api/pm";
|
||||||
|
import { getMaterialList } from "@/api/mtm";
|
||||||
|
import checkPermission from "@/utils/permission";
|
||||||
|
|
||||||
|
|
||||||
|
import { genTree } from "@/utils";
|
||||||
|
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||||
|
const defaulteorderplan = {
|
||||||
|
};
|
||||||
|
export default {
|
||||||
|
components: { Pagination },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
|
||||||
|
orderplan: defaulteorderplan,
|
||||||
|
orderList: {
|
||||||
|
count: 0,
|
||||||
|
},
|
||||||
|
listQuery: {
|
||||||
|
page: 1,
|
||||||
|
page_size: 20,
|
||||||
|
},
|
||||||
|
productionplanList: {
|
||||||
|
count: 0,
|
||||||
|
},
|
||||||
|
listQuery1: {
|
||||||
|
page: 1,
|
||||||
|
page_size: 20,
|
||||||
|
},
|
||||||
|
value1: '',
|
||||||
|
listLoading: true,
|
||||||
|
dialogVisible: false,
|
||||||
|
dialogType: "new",
|
||||||
|
rule1: {
|
||||||
|
number: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||||
|
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {},
|
||||||
|
watch: {},
|
||||||
|
created() {
|
||||||
|
|
||||||
|
this.getorderList();
|
||||||
|
this.getplanList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
checkPermission,
|
||||||
|
//订单列表
|
||||||
|
getorderList() {
|
||||||
|
this.listLoading = true;
|
||||||
|
getordertoplan(this.listQuery).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.orderList = response.data;
|
||||||
|
}
|
||||||
|
this.listLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//生产计划列表
|
||||||
|
//列表
|
||||||
|
getplanList() {
|
||||||
|
this.listLoading = true;
|
||||||
|
getProductionplanList(this.listQuery).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.productionplanList = response.data;
|
||||||
|
}
|
||||||
|
this.listLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleclick(scope){
|
||||||
|
this.orderID = scope.row.id;
|
||||||
|
|
||||||
|
this.dialogVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs["Form"].clearValidate();
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
async confirm(form) {
|
||||||
|
|
||||||
|
this.orderplan.start_date = this.value1[0];
|
||||||
|
this.orderplan.end_date = this.value1[1];
|
||||||
|
this.orderplan.order = this.orderID
|
||||||
|
createProductionplan(this.orderplan).then((res) => {
|
||||||
|
if (res.code >= 200) {
|
||||||
|
this.getorderList();
|
||||||
|
this.getplanList();
|
||||||
|
this.dialogVisible = false;
|
||||||
|
this.$message.success("成功");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
</script>
|
|
@ -0,0 +1,308 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-card >
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>合同订单列表</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
:data="orderList.results"
|
||||||
|
border
|
||||||
|
fit
|
||||||
|
stripe
|
||||||
|
style="width: 100%"
|
||||||
|
|
||||||
|
>
|
||||||
|
<el-table-column type="index" width="50" />
|
||||||
|
|
||||||
|
<el-table-column label="订单编号">
|
||||||
|
<template slot-scope="scope">{{ scope.row.number }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="客户">
|
||||||
|
<template slot-scope="scope">{{ scope.row.customer_.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="所属合同">
|
||||||
|
<template slot-scope="scope">{{ scope.row.contract_.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="所需产品">
|
||||||
|
<template slot-scope="scope">{{ scope.row.product_.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="产品型号">
|
||||||
|
<template slot-scope="scope">{{ scope.row.product_.specification }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<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.planed_count }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="交货日期">
|
||||||
|
<template slot-scope="scope">{{ scope.row.delivery_date }}</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="120px"
|
||||||
|
fixed="right"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
|
||||||
|
<el-link type="primary"
|
||||||
|
v-if="checkPermission(['warehouse_update'])"
|
||||||
|
@click="handleclick(scope)"
|
||||||
|
>排产</el-link
|
||||||
|
>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination
|
||||||
|
v-show="orderList.count > 0"
|
||||||
|
:total="orderList.count"
|
||||||
|
:page.sync="listQuery.page"
|
||||||
|
:limit.sync="listQuery.page_size"
|
||||||
|
@pagination="getorderList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-card >
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>物料配置</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
:data="orderList.results"
|
||||||
|
border
|
||||||
|
fit
|
||||||
|
stripe
|
||||||
|
style="width: 100%"
|
||||||
|
|
||||||
|
>
|
||||||
|
<el-table-column type="index" width="50" />
|
||||||
|
|
||||||
|
<el-table-column label="订单编号">
|
||||||
|
<template slot-scope="scope">{{ scope.row.number }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="客户">
|
||||||
|
<template slot-scope="scope">{{ scope.row.customer_.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="所属合同">
|
||||||
|
<template slot-scope="scope">{{ scope.row.contract_.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="所需产品">
|
||||||
|
<template slot-scope="scope">{{ scope.row.product_.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="产品型号">
|
||||||
|
<template slot-scope="scope">{{ scope.row.product_.specification }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<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.planed_count }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="交货日期">
|
||||||
|
<template slot-scope="scope">{{ scope.row.delivery_date }}</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="120px"
|
||||||
|
fixed="right"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
|
||||||
|
<el-link type="primary"
|
||||||
|
v-if="checkPermission(['warehouse_update'])"
|
||||||
|
@click="handleclick(scope)"
|
||||||
|
>排产</el-link
|
||||||
|
>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination
|
||||||
|
v-show="orderList.count > 0"
|
||||||
|
:total="orderList.count"
|
||||||
|
:page.sync="listQuery.page"
|
||||||
|
:limit.sync="listQuery.page_size"
|
||||||
|
@pagination="getorderList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-card >
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>设备配置</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
:data="orderList.results"
|
||||||
|
border
|
||||||
|
fit
|
||||||
|
stripe
|
||||||
|
style="width: 100%"
|
||||||
|
|
||||||
|
>
|
||||||
|
<el-table-column type="index" width="50" />
|
||||||
|
|
||||||
|
<el-table-column label="订单编号">
|
||||||
|
<template slot-scope="scope">{{ scope.row.number }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="客户">
|
||||||
|
<template slot-scope="scope">{{ scope.row.customer_.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="所属合同">
|
||||||
|
<template slot-scope="scope">{{ scope.row.contract_.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="所需产品">
|
||||||
|
<template slot-scope="scope">{{ scope.row.product_.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="产品型号">
|
||||||
|
<template slot-scope="scope">{{ scope.row.product_.specification }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<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.planed_count }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="交货日期">
|
||||||
|
<template slot-scope="scope">{{ scope.row.delivery_date }}</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="120px"
|
||||||
|
fixed="right"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
|
||||||
|
<el-link type="primary"
|
||||||
|
v-if="checkPermission(['warehouse_update'])"
|
||||||
|
@click="handleclick(scope)"
|
||||||
|
>排产</el-link
|
||||||
|
>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination
|
||||||
|
v-show="orderList.count > 0"
|
||||||
|
:total="orderList.count"
|
||||||
|
:page.sync="listQuery.page"
|
||||||
|
:limit.sync="listQuery.page_size"
|
||||||
|
@pagination="getorderList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { getordertoplan } from "@/api/sam";
|
||||||
|
import { createProductionplan,getProductionplanList} from "@/api/pm";
|
||||||
|
import { getMaterialList } from "@/api/mtm";
|
||||||
|
import checkPermission from "@/utils/permission";
|
||||||
|
|
||||||
|
|
||||||
|
import { genTree } from "@/utils";
|
||||||
|
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||||
|
const defaulteorderplan = {
|
||||||
|
};
|
||||||
|
export default {
|
||||||
|
components: { Pagination },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
|
||||||
|
orderplan: defaulteorderplan,
|
||||||
|
orderList: {
|
||||||
|
count: 0,
|
||||||
|
},
|
||||||
|
listQuery: {
|
||||||
|
page: 1,
|
||||||
|
page_size: 20,
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
listLoading: true,
|
||||||
|
dialogVisible: false,
|
||||||
|
dialogType: "new",
|
||||||
|
rule1: {
|
||||||
|
number: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||||
|
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {},
|
||||||
|
watch: {},
|
||||||
|
created() {
|
||||||
|
|
||||||
|
this.getorderList();
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
checkPermission,
|
||||||
|
//订单列表
|
||||||
|
getorderList() {
|
||||||
|
this.listLoading = true;
|
||||||
|
getordertoplan(this.listQuery).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.orderList = response.data;
|
||||||
|
}
|
||||||
|
this.listLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
handleclick(scope){
|
||||||
|
this.orderID = scope.row.id;
|
||||||
|
|
||||||
|
this.dialogVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs["Form"].clearValidate();
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
async confirm(form) {
|
||||||
|
|
||||||
|
this.orderplan.start_date = this.value1[0];
|
||||||
|
this.orderplan.end_date = this.value1[1];
|
||||||
|
this.orderplan.order = this.orderID
|
||||||
|
createProductionplan(this.orderplan).then((res) => {
|
||||||
|
if (res.code >= 200) {
|
||||||
|
this.getorderList();
|
||||||
|
this.getplanList();
|
||||||
|
this.dialogVisible = false;
|
||||||
|
this.$message.success("成功");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
</script>
|
Loading…
Reference in New Issue