chanpinguanli

This commit is contained in:
shilixia 2021-10-13 09:27:15 +08:00
parent bf375e000a
commit 19b684192a
11 changed files with 1086 additions and 55 deletions

View File

@ -1,5 +1,6 @@
import request from '@/utils/request'
//物料
export function getMaterialList(query) {
return request({
url: '/mtm/material/',
@ -34,6 +35,36 @@ export function deleteMaterial(id, 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) {
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({
url: `/mtm/process/${id}/steps/`,
method: 'get'

18
hb_client/src/api/pm.js Normal file
View File

@ -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
})
}

View File

@ -87,3 +87,10 @@ export function deleteOrder(id, data) {
data
})
}
export function getordertoplan() {
return request({
url: '/sam/order/toplan/',
method: 'get',
})
}

View File

@ -130,6 +130,34 @@ export const asyncRoutes = [
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',
@ -233,6 +261,13 @@ export const asyncRoutes = [
name: 'warehouse',
component: () => import('@/views/inm/warehouse'),
meta: { title: '仓库', icon: 'example', perms: ['index_manage'] }
},
{
path: 'materialbatch/:id',
name: 'MaterialBatch',
component: () => import('@/views/inm/materialbatch'),
meta: { title: '仓库物料', perms: ['vendor_manage'] },
hidden: true
}
,
{

View File

@ -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>

View File

@ -177,9 +177,9 @@ export default {
this.listLoading = false;
});
},
//跳转到该仓库的物料表
handleMaterial(scope){
alert(1)
this.$router.push({name: "MaterialBatch", params: { id: scope.row.id }, })
},
handleFilter() {
this.listQuery.page = 1;

View File

@ -61,16 +61,7 @@
<el-form-item label="表格名称" prop="name">
<el-input v-model="recordform.name" placeholder="表格名称" />
</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>

View File

@ -15,8 +15,7 @@
fit
stripe
highlight-current-row
height="100"
v-el-height-adaptive-table="{bottomOffset: 50}"
@current-change="handleCurrentChange">
<el-table-column type="index" width="50" />
@ -30,9 +29,6 @@
</el-table>
</el-card>
</el-col>
<el-col :span="18" >
<el-card >
<el-descriptions class="margin-top" title="产品信息" :column="3" border>
@ -56,7 +52,9 @@
</el-descriptions>
</el-card>
<el-card class="box-card">
</el-col>
<el-col :span="18" >
<el-card class="box-card">
<div slot="header" class="clearfix">
<span style="font-size: 16px;
font-weight: 700;
@ -68,6 +66,87 @@
</el-step>
</el-steps>
</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-tab-pane label="输入物料">
@ -272,8 +351,10 @@
<el-table-column label="子工序名称">
<template slot-scope="scope">{{ scope.row.step_.name }}</template>
</el-table-column >
<el-table-column label="备注">
<template slot-scope="scope">{{ scope.row.remark }}</template>
</el-table-column >
<el-table-column
align="center"
label="操作"
@ -318,7 +399,9 @@
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="usedstep.remark" placeholder="输入备注信息" />
</el-form-item>
</el-form>
<div style="text-align: right">
@ -327,10 +410,7 @@
</div>
</el-dialog>
</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-button type="primary" icon="el-icon-plus" @click="handletechdocCreate"
>新增</el-button>
@ -426,7 +506,8 @@
<script>
import { getMaterialList,getMaterial,getInputmaterialList,createInputmaterial,updateInputmaterial
,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 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
@ -446,6 +527,9 @@ const defaultusedstep = {
};
const defaulttechdoc = {
};
const defaultsubproducation = {
};
export default {
@ -454,9 +538,11 @@ export default {
data() {
return {
materialoptions:[],
inputtableData:"",
subproducationData:"",
inputtableData:"",
editorOption: {} ,
techdoc: defaulttechdoc,
subproducation:defaultsubproducation,
inputmaterial: defaultinputmaterial,
techdoctableData:"",
outputtableData:"",
@ -475,6 +561,9 @@ export default {
page: 1,
page_size: 20,
},
listQuerysubproducation: {
page: 0,
},
listQueryinput: {
page: 0,
},
@ -487,10 +576,15 @@ export default {
listQuerytechdoc:{
page: 0,
},
listQuerystep:{
page: 0,
},
values:7,
products:"",
dialogType: "new",
dialogVisible:false,
dialogTypesp: "new",
dialogVisiblesp:false,
dialogType1: "new",
dialogVisible1:false,
dialogTypeusedstep: "new",
@ -545,8 +639,19 @@ export default {
handleCurrentChange(row){
this.product=row.id;
this.getMaterial();
this.getsubproducationList();
},
//点击产品分解弹出输入输出物料子工序技术文件
handlespChange(row){
this.subproduction = row.id;
this.getmaterialList();//物料列表
this.getInputmaterialLists();//输入物料
this.getOutputmaterialLists();//输出物料
this.getstepList();//子工序
this. getUsedstepLists();//
this.gettechdocLists();//技术文件
},
//工艺点击信息
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(){
this.listQueryinput.process=this.process;
this.listQueryinput.product=this.product
this.listQueryinput.subproduction=this.subproduction;
getInputmaterialList(this.listQueryinput).then((response) => {
if (response.data) {
@ -617,8 +791,7 @@ export default {
if (valid) {
const isEdit = this.dialogType === "edit";
if (isEdit) {
this.inputmaterial.process=this.process;
this.inputmaterial.product=this.product;
this.inputmaterial.subproduction=this.subproduction;
updateInputmaterial(this.inputmaterial.id, this.inputmaterial).then((res) => {
if (res.code >= 200) {
this.getInputmaterialLists()
@ -627,8 +800,7 @@ export default {
}
});
} else {
this.inputmaterial.process=this.process;
this.inputmaterial.product=this.product;
this.inputmaterial.subproduction=this.subproduction;
createInputmaterial(this.inputmaterial).then((res) => {
if (res.code >= 200) {
this.getInputmaterialLists()
@ -650,8 +822,7 @@ export default {
getOutputmaterialLists(){
this.listQueryoutput.process=this.process;
this.listQueryoutput.product=this.product
this.listQueryoutput.subproduction=this.subproduction;
// this.listQueryoutput.page=0;
getOutputmaterialList(this.listQueryoutput).then((response) => {
if (response.data) {
@ -700,8 +871,7 @@ export default {
if (valid) {
const isEdit = this.dialogType1 === "edit";
if (isEdit) {
this.outputmaterial.process=this.process;
this.outputmaterial.product=this.product;
this.outputmaterial.subproduction=this.subproduction;
updateOutputmaterial(this.outputmaterial.id, this.outputmaterial).then((res) => {
if (res.code >= 200) {
this.getOutputmaterialLists()
@ -710,8 +880,7 @@ export default {
}
});
} else {
this.outputmaterial.process=this.process;
this.outputmaterial.product=this.product;
this.outputmaterial.subproduction=this.subproduction;
console.log(this.outputmaterial);
createOutputmaterial(this.outputmaterial).then((res) => {
if (res.code >= 200) {
@ -730,8 +899,7 @@ export default {
getUsedstepLists(){
this.listQueryusedstep.process=this.process;
this.listQueryusedstep.product=this.product
this.listQueryusedstep.subproduction=this.subproduction;
// this.listQueryusedstep.page=0;
getUsedstepList(this.listQueryusedstep).then((response) => {
if (response.data) {
@ -744,7 +912,7 @@ export default {
getstepList() {
getStepList(this.process).then((response) => {
getStepList(this.listQuerystep).then((response) => {
if (response.data) {
this.stepoptions = genTree(response.data);
}
@ -794,12 +962,12 @@ export default {
},
async usedstepconfirm(form) {
this.usedstep.process=this.process;
this.usedstep.product=this.product;
this.usedstep.subproduction=this.subproduction;
console.log(this.usedstep);
createUsedstep(this.usedstep).then((res) => {
if (res.code >= 200) {
this.getUsedstepLists()
this.getUsedstepLists();
this.getMaterial();
this.dialogVisibleusedstep = false;
this.$message.success("成功");
}
@ -807,8 +975,7 @@ export default {
},
//技术文件
gettechdocLists(){
this.listQuerytechdoc.process=this.process;
this.listQuerytechdoc.product=this.product;
this.listQuerytechdoc.subproduction=this.subproduction;
// this.listQuerytechdoc.page=0;
gettechdocList(this.listQuerytechdoc).then((response) => {
if (response.data) {
@ -887,8 +1054,7 @@ export default {
}
});
} else {
this.techdoc.process=this.process;
this.techdoc.product=this.product;
this.techdoc.subproduction=this.subproduction;
createtechdoc(this.techdoc).then((res) => {
if (res.code >= 200) {
this.gettechdocLists();

View File

@ -356,7 +356,7 @@
</template>
<script>
import { getStepList, createStep,updateStep,deleteStep } from "@/api/mtm";
import { getStepLists, createStep,updateStep,deleteStep } from "@/api/mtm";
import checkPermission from "@/utils/permission";
import { getEquipmentAll } from "@/api/equipment";
import { upUrl, upHeaders } from "@/api/file";
@ -502,7 +502,7 @@
//子工序列表
getList() {
this.listLoading = true;
getStepList(this.step.process).then((response) => {
getStepLists(this.step.process).then((response) => {
if (response.data) {
this.stepList = response.data;
}

View File

@ -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>

View File

@ -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>