Merge branch 'develop' of https://e.coding.net/ctcdevteam/hberp/hberp into develop

This commit is contained in:
caoqianming 2021-10-14 15:11:08 +08:00
commit 1dbc8e2398
5 changed files with 173 additions and 156 deletions

View File

@ -15,4 +15,19 @@ export function createProductionplan(data) {
data
})
}
//计算物料配置
export function createresource(data) {
return request({
url: '/pm/resource/cal/',
method: 'post',
data
})
}
//产品对应的设备
export function createequip(data) {
return request({
url: '/pm/resource/cal_equip/',
method: 'post',
data
})
}

View File

@ -144,14 +144,7 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="绑定工序" prop="processes" v-if="material.type==1">
<el-transfer
v-model="material.processes"
:data="processOptions"
:titles="['工序清单', '选择的工序清单']"
:props="{ key: 'id', label: 'name' }"
/>
</el-form-item>
<el-form-item label="排序" prop="sort_str">
<el-input v-model="material.sort_str" placeholder="排序" />
</el-form-item>

View File

@ -80,13 +80,17 @@
border
fit
stripe
highlight-current-row
@current-change="handlespChange"
>
<el-table-column type="index" width="50" />
<el-table-column label="物料编号">
<el-table-column label="分解产品名称">
<template slot-scope="scope">{{scope.row.name}}</template>
</el-table-column>
<el-table-column label="单位消耗量">
<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.sort }}</template>
</el-table-column>
@ -128,6 +132,17 @@
<el-form-item label="名称" prop="name">
<el-input v-model="subproducation.name" />
</el-form-item>
<el-form-item label="绑定工序" prop="process" >
<el-select v-model="subproducation.process" placeholder="请选择" >
<el-option
v-for="item in processOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input-number
v-model="subproducation.sort"
@ -213,17 +228,11 @@
>
<el-form-item label="消耗量" prop="count">
<el-input v-model="inputmaterial.count" placeholder="输入整数或小数" />
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input-number
v-model="inputmaterial.sort"
:min="-2147483648"
:max="2147483647"
></el-input-number>
<el-input-number v-model="inputmaterial.count" :min="0" placeholder="输入整数或小数" />
</el-form-item>
<el-form-item label="输入物料" prop="unit">
<el-select style="width: 100%" v-model="inputmaterial.material" placeholder="请选择">
<el-select filterable style="width: 100%" v-model="inputmaterial.material" placeholder="请选择">
<el-option
v-for="item in materialoptions"
:key="item.value"
@ -232,7 +241,13 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input-number
v-model="inputmaterial.sort"
:min="-2147483648"
:max="2147483647"
></el-input-number>
</el-form-item>
</el-form>
@ -305,15 +320,9 @@
>
<el-form-item label="产出量" prop="count">
<el-input v-model="outputmaterial.count" placeholder="输入整数或小数" />
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input-number
v-model="outputmaterial.sort"
:min="-2147483648"
:max="2147483647"
></el-input-number>
<el-input-number v-model="outputmaterial.count" :min="0" />
</el-form-item>
<el-form-item label="输出物料" prop="unit">
<el-select style="width: 100%" v-model="outputmaterial.material" placeholder="请选择">
<el-option
@ -325,7 +334,13 @@
</el-select>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input-number
v-model="outputmaterial.sort"
:min="-2147483648"
:max="2147483647"
></el-input-number>
</el-form-item>
</el-form>
<div style="text-align: right">
@ -507,11 +522,12 @@
import { getMaterialList,getMaterial,getInputmaterialList,createInputmaterial,updateInputmaterial
,deleteInputmaterial,getOutputmaterialList,createOutputmaterial,updateOutputmaterial,deleteOutputmaterial,
getUsedstepList,createUsedstep,deleteUsedstep,getStepList,gettechdocList,createtechdoc,updatetechdoc,deletetechdoc
,getsubproducationList,createsubproducation,updatesubproducation,deletesubproducation } from "@/api/mtm";
,getsubproducationList,createsubproducation,updatesubproducation,deletesubproducation,getProcessList } from "@/api/mtm";
import { quillEditor } from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
import { upUrl, upHeaders } from "@/api/file";
import checkPermission from "@/utils/permission";
import { genTree } from "@/utils";
@ -529,7 +545,7 @@ const defaulttechdoc = {
};
const defaultsubproducation = {
};
export default {
@ -541,6 +557,7 @@ export default {
subproducationData:"",
inputtableData:"",
editorOption: {} ,
processOptions:[],
techdoc: defaulttechdoc,
subproducation:defaultsubproducation,
inputmaterial: defaultinputmaterial,
@ -625,7 +642,12 @@ export default {
this.listLoading = false;
});
},
//工序清单
getProcessList() {
getProcessList().then((res) => {
this.processOptions = genTree(res.data.results);
});
},
//获取产品工艺
getMaterial(){
getMaterial(this.product).then((response) => {
@ -639,11 +661,14 @@ export default {
handleCurrentChange(row){
this.product=row.id;
this.getMaterial();
this.getProcessList();
this.getsubproducationList();
},
//点击产品分解弹出输入输出物料子工序技术文件
handlespChange(row){
this.subproduction = row.id;
this.processes = row.process;
this.getmaterialList();//物料列表
this.getInputmaterialLists();//输入物料
@ -911,7 +936,7 @@ export default {
},
getstepList() {
this.listQuerystep.process=this.processes;
getStepList(this.listQuerystep).then((response) => {
if (response.data) {
this.stepoptions = genTree(response.data);
@ -1071,3 +1096,4 @@ export default {
},
};
</script>

View File

@ -159,7 +159,7 @@
<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-input-number v-model="orderplan.count" :min="0"></el-input-number>
</el-form-item>

View File

@ -7,60 +7,60 @@
<span>合同订单列表</span>
</div>
<el-button type="primary" @click="handlecount"
>计算物料</el-button>
<el-table
:data="orderList.results"
border
fit
stripe
style="width: 100%"
>
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55">
</el-table-column>
<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.product_.name }}</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="计划生产数" width="140px">
<template slot-scope="scope" >
<el-form :model="scope.row">
<el-form-item size="mini">
<el-input-number v-model="scope.row.pgcount" :min="0"></el-input-number>
</el-form-item>
</el-form>
</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.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"
@ -81,7 +81,7 @@
</div>
<el-table
:data="orderList.results"
:data="materialpzTable"
border
fit
stripe
@ -90,58 +90,25 @@
>
<el-table-column type="index" width="50" />
<el-table-column label="订单编号">
<el-table-column label="物料名称">
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column>
<el-table-column label="物料类型">
<template slot-scope="scope"> {{options_[scope.row.type]}}</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.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="所需数量">
<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 label="库存量">
<template slot-scope="scope">{{ scope.row.inv_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>
@ -154,59 +121,30 @@
</div>
<el-table
:data="orderList.results"
:data="equipmentTable"
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 label="设备名称">
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column>
<el-table-column label="客户">
<template slot-scope="scope">{{ scope.row.customer_.name }}</template>
<el-table-column label="设备状态">
<template slot-scope="scope"> {{state_[scope.row.state]}}</template>
</el-table-column>
<el-table-column label="所属合同">
<template slot-scope="scope">{{ scope.row.contract_.name }}</template>
<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.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 label="设备型号">
<template slot-scope="scope"> {{scope.row.model}}</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"
@ -226,7 +164,7 @@
</template>
<script>
import { getordertoplan } from "@/api/sam";
import { createProductionplan,getProductionplanList} from "@/api/pm";
import { createProductionplan,getProductionplanList,createresource,createequip} from "@/api/pm";
import { getMaterialList } from "@/api/mtm";
import checkPermission from "@/utils/permission";
@ -243,13 +181,30 @@ export default {
orderplan: defaulteorderplan,
orderList: {
count: 0,
},
options_:{
"1":'成品',
"2":'半成品',
"3":'主要原料',
"4":'辅助原料',
"5":'加工工具',
"6":'辅助工具',
},
state_:{
0:'完好',
1:'限用',
2:'在修',
3:'禁用',
},
listQuery: {
page: 1,
page_size: 20,
},
materialpzTable:"",
mutipID:[],
equipmentTable:[],
listLoading: true,
dialogVisible: false,
dialogType: "new",
@ -278,7 +233,35 @@ export default {
this.listLoading = false;
});
},
handleSelectionChange(row) {
let _this=this
_this.mutipID=[]
row.forEach((item) => {
_this.mutipID.push({
"id":item.product_.id,
"count": item.pgcount
});
});
},
//物料计算
handlecount()
{
createresource(this.mutipID).then((res) => {
if (res.code >= 200) {
this.materialpzTable=res.data;
this.$message.success("物料计算成功");
}
});
createequip(this.mutipID).then((res) => {
if (res.code >= 200) {
this.equipmentTable=res.data;
this.$message.success("成功");
}
});
},
handleclick(scope){
this.orderID = scope.row.id;