“xial”

This commit is contained in:
shilixia 2022-02-17 14:33:55 +08:00
parent 9e5efe57d4
commit 9d4238668c
3 changed files with 330 additions and 309 deletions

View File

@ -357,7 +357,7 @@ export default {
handleDetail(scope) { handleDetail(scope) {
this.$router.push({ this.$router.push({
name: "fifodetail", name: "fifodetail",
params: { id: scope.row.id, pu_order: scope.row.pu_order }, params: { id: scope.row.id, pu_order: scope.row.pu_order},
}); });
}, },

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-card style="margin-top: 2px"> <el-card style="margin-top: 2px">
<el-button type="primary" icon="el-icon-plus" @click="handlecgxCreate" <el-button v-if="this.$route.params.pu_order!=null" type="primary" icon="el-icon-plus" @click="handlecgxCreate"
>新增采购项入库</el-button >新增采购项入库</el-button
> >
<el-table <el-table
@ -39,20 +39,20 @@
<el-table-column label="入库数量"> <el-table-column label="入库数量">
<template slot-scope="scope">{{ scope.row.count }}</template> <template slot-scope="scope">{{ scope.row.count }}</template>
</el-table-column> </el-table-column>
<el-table-column label="是否需要复验"> <el-table-column label="是否需要复验" v-if="this.$route.params.pu_order!=null">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.need_test == false"></el-tag> <el-tag v-if="scope.row.need_test == false"></el-tag>
<el-tag v-else></el-tag> <el-tag v-else></el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="复验是否合格"> <el-table-column label="复验是否合格" v-if="this.$route.params.pu_order!=null">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.is_testok == false">不合格</el-tag> <el-tag v-if="scope.row.is_testok == false">不合格</el-tag>
<el-tag v-else>合格</el-tag> <el-tag v-else>合格</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="文件"> <el-table-column label="文件" v-if="this.$route.params.pu_order!=null">
<template slot-scope="scope" v-if="scope.row.files"> <template slot-scope="scope" v-if="scope.row.files">
<div v-for="item in scope.row.files_" v-bind:key="item.id"> <div v-for="item in scope.row.files_" v-bind:key="item.id">
<el-link :href="item.path" target="_blank" type="primary">{{ <el-link :href="item.path" target="_blank" type="primary">{{
@ -61,7 +61,7 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="操作" width="220px"> <el-table-column align="center" label="操作" width="220px" v-if="this.$route.params.pu_order!=null">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link <el-link
type="primary" type="primary"

View File

@ -1,282 +1,310 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-card > <el-card>
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>合同订单列表</span> <span>合同订单列表</span>
</div>
<el-button type="primary" @click="handlecount">计算物料</el-button>
<el-table
:data="orderList.results"
ref="multipleTable"
border
fit
stripe
highlight-current-row
height="100"
v-el-height-adaptive-table="{ bottomOffset: 25 }"
>
<el-table-column type="selection" width="55"> </el-table-column>
</div> <el-table-column label="订单编号" width="110">
<el-button type="primary" @click="handlecount" <template slot-scope="scope">{{ scope.row.number }}</template>
>计算物料</el-button> </el-table-column>
<el-table
:data="orderList.results"
ref="multipleTable"
border
fit
stripe
highlight-current-row
height="100"
v-el-height-adaptive-table="{bottomOffset: 25}"
>
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column label="所需产品" show-overflow-tooltip width="150">
<template slot-scope="scope">{{
scope.row.product_.name
}}</template>
</el-table-column>
<el-table-column label="订单编号" width="110"> <el-table-column label="产品数量">
<template slot-scope="scope">{{ scope.row.number }}</template> <template slot-scope="scope">{{ scope.row.count }}</template>
</el-table-column> </el-table-column>
<el-table-column label="已派数量">
<template slot-scope="scope">{{
scope.row.planed_count
}}</template>
</el-table-column>
<el-table-column label="所需产品" show-overflow-tooltip width="150"> <el-table-column label="产品型号">
<template slot-scope="scope">{{ scope.row.product_.name }}</template> <template slot-scope="scope">{{
</el-table-column> scope.row.product_.specification
}}</template>
</el-table-column>
<el-table-column label="客户名称" show-overflow-tooltip width="150">
<template slot-scope="scope">{{
scope.row.customer_.name
}}</template>
</el-table-column>
<el-table-column label="合同编号" show-overflow-tooltip width="150">
<template slot-scope="scope">{{
scope.row.contract_.number
}}</template>
</el-table-column>
<el-table-column label="合同名称" show-overflow-tooltip width="150">
<template slot-scope="scope">{{
scope.row.contract_.name
}}</template>
</el-table-column>
<el-table-column label="交货日期" width="110">
<template slot-scope="scope">{{
scope.row.delivery_date
}}</template>
</el-table-column>
<el-table-column label="创建时间" width="110">
<template slot-scope="scope">{{
scope.row.create_time
}}</template>
</el-table-column>
<el-table-column label="计划生产数" width="150px" fixed="right">
<template slot-scope="scope">
<el-form :model="scope.row">
<el-form-item size="mini">
<el-input-number
v-model="scope.row.pgcount"
:min="0"
:value="0"
></el-input-number>
</el-form-item>
</el-form>
</template>
</el-table-column>
</el-table>
<el-table-column label="产品数量"> <pagination
<template slot-scope="scope">{{ scope.row.count }}</template> v-show="orderList.count > 0"
</el-table-column> :total="orderList.count"
<el-table-column label="已派数量"> :page.sync="listQuery.page"
<template slot-scope="scope">{{ scope.row.planed_count }}</template> :limit.sync="listQuery.page_size"
</el-table-column> @pagination="getorderList"
/>
<el-table-column label="产品型号"> </el-card>
<template slot-scope="scope">{{ scope.row.product_.specification }}</template> </el-col>
</el-table-column> <el-col :span="12">
<el-table-column label="客户名称" show-overflow-tooltip width="150"> <el-row>
<template slot-scope="scope">{{ scope.row.customer_.name }}</template> <el-col :span="24">
</el-table-column> <el-card>
<el-table-column label="合同编号" show-overflow-tooltip width="150"> <div slot="header" class="clearfix">
<template slot-scope="scope">{{ scope.row.contract_.number }}</template> <span>物料配置</span>
</el-table-column> <el-button
<el-table-column label="合同名称" show-overflow-tooltip width="150"> style="float: right; padding: 3px 0"
<template slot-scope="scope">{{ scope.row.contract_.name }}</template> @click="handlebcpcount"
</el-table-column> type="primary"
<el-table-column label="交货日期" width="110"> v-if="butshow"
<template slot-scope="scope">{{ scope.row.delivery_date }}</template> >半成品折合</el-button
</el-table-column> >
<el-table-column label="创建时间" width="110">
<template slot-scope="scope">{{ scope.row.create_time }}</template>
</el-table-column>
<el-table-column label="计划生产数" width="150px" fixed="right">
<template slot-scope="scope" >
<el-form :model="scope.row">
<el-form-item size="mini">
<el-input-number v-model="scope.row.pgcount" :min="0" :value="0"></el-input-number>
</el-form-item>
</el-form>
</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>
<el-button style="float: right; padding: 3px 0" @click="handlebcpcount" type="primary">半成品折合</el-button>
</div>
<el-table
:data="materialpzTable"
border
fit
stripe
style="width: 100%"
height="300"
ref="multipleTables"
>
<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.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="生产所需数量" width="150">
<template slot-scope="scope">
<div v-if="scope.row.type==2">
<el-form :model="scope.row">
<el-form-item size="mini">
<el-input-number v-model="scope.row.bcpcount" :min="0" :value="0"></el-input-number>
</el-form-item>
</el-form>
</div> </div>
<div v-else> {{ scope.row.count }}</div></template> <el-table
</el-table-column> :data="materialpzTable"
<el-table-column label="剩余量" > border
<template slot-scope="scope"> fit
<el-tag v-if="scope.row.count_safe!=null&&scope.row.count_safe>(scope.row.inv_count-scope.row.count)" type="danger"> {{ scope.row.inv_count-scope.row.count }}</el-tag> stripe
<el-tag v-else> {{ scope.row.inv_count-scope.row.count }}</el-tag> style="width: 100%"
</template> height="330"
</el-table-column> ref="multipleTables"
<el-table-column label="安全库存"> >
<template slot-scope="scope">{{ scope.row.count_safe }}</template> <el-table-column type="selection" width="55"> </el-table-column>
</el-table-column> <el-table-column type="index" width="50" />
</el-table> <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="生产所需数量" width="150">
<template slot-scope="scope">
<div v-if="scope.row.type == 2">
<el-form :model="scope.row">
<el-form-item size="mini">
<el-input-number
v-model="scope.row.bcpcount"
:min="0"
:value="0"
></el-input-number>
</el-form-item>
</el-form>
</div>
<div v-else>{{ scope.row.count }}</div></template
>
</el-table-column>
<el-table-column label="剩余量">
<template slot-scope="scope">
<el-tag
v-if="
scope.row.count_safe != null &&
scope.row.count_safe >
scope.row.inv_count - scope.row.count
"
type="danger"
>
{{ scope.row.inv_count - scope.row.count }}</el-tag
>
<el-tag v-else>
{{ scope.row.inv_count - scope.row.count }}</el-tag
>
</template>
</el-table-column>
<el-table-column label="安全库存">
<template slot-scope="scope">{{
scope.row.count_safe
}}</template>
</el-table-column>
</el-table>
</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="equipmentTable"
border
fit
stripe
style="width: 100%"
height="280"
>
<el-table-column type="index" width="50" />
<el-table-column label="设备名称">
</el-card> <template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column>
<el-table-column label="设备状态">
<template slot-scope="scope">
<div v-if="scope.row.equip_.type === 2">
<el-tag
v-if="scope.row.equip_.state === 40"
type="danger"
>
禁用
</el-tag>
<el-tag v-else type="success"> 合格 </el-tag>
</div>
<div v-else>
<el-tag v-if="scope.row.state === 10" type="success">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else-if="scope.row.state === 20">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else-if="scope.row.state === 30" type="warning">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else type="danger">
{{ state_[scope.row.state] }}
</el-tag>
</div>
</template>
<template slot-scope="scope">
{{ state_[scope.row.state] }}</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.model }}</template>
</el-table-column>
</el-table>
<pagination
v-show="equipmentTable.count > 0"
:total="equipmentTable.count"
:page.sync="listQuery.page"
:limit.sync="listQuery.page_size"
@pagination="getorderList"
/>
</el-card>
</el-col>
</el-row>
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<el-col :span="24">
<el-card >
<div slot="header" class="clearfix">
<span>设备配置</span>
</div>
<el-table
:data="equipmentTable"
border
fit
stripe
style="width: 100%"
height="280"
>
<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">
<div v-if="scope.row.equip_.type===2">
<el-tag v-if="scope.row.equip_.state===40" type="danger">
禁用
</el-tag>
<el-tag v-else type="success">
合格
</el-tag>
</div>
<div v-else>
<el-tag v-if="scope.row.state===10" type="success">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else-if="scope.row.state===20">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else-if="scope.row.state===30" type="warning">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else type="danger">
{{ state_[scope.row.state] }}
</el-tag>
</div>
</template>
<template slot-scope="scope"> {{state_[scope.row.state]}}</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.model}}</template>
</el-table-column>
</el-table>
<pagination
v-show="equipmentTable.count > 0"
:total="equipmentTable.count"
:page.sync="listQuery.page"
:limit.sync="listQuery.page_size"
@pagination="getorderList"
/>
</el-card>
</el-col>
</el-row>
</el-col>
</el-row>
</div> </div>
</template> </template>
<script> <script>
import { getordertoplan } from "@/api/sam"; import { getordertoplan } from "@/api/sam";
import { createProductionplan,createConvert,createresource,createequip} from "@/api/pm"; import {
createProductionplan,
createConvert,
createresource,
createequip,
} from "@/api/pm";
import { getMaterialList } from "@/api/mtm"; import { getMaterialList } from "@/api/mtm";
import checkPermission from "@/utils/permission"; import checkPermission from "@/utils/permission";
import { genTree } from "@/utils"; import { genTree } from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaulteorderplan = { const defaulteorderplan = {};
};
export default { export default {
components: { Pagination }, components: { Pagination },
data() { data() {
return { return {
orderplan: defaulteorderplan,
orderplan: defaulteorderplan,
orderList: { orderList: {
count: 0, count: 0,
}, },
options_:{ options_: {
1: "成品",
"1":'成品', 2: "半成品",
"2":'半成品', 3: "主要原料",
"3":'主要原料', 4: "辅助原料",
"4":'辅助原料', 5: "加工工具",
"5":'加工工具', 6: "辅助工具",
"6":'辅助工具',
}, },
state_: { state_: {
10: '完好', 10: "完好",
20: '限用', 20: "限用",
30: '在修', 30: "在修",
40: '禁用', 40: "禁用",
}, },
listQuery: { listQuery: {
page: 1, page: 1,
page_size: 20, page_size: 20,
}, },
materialpzTable:"", materialpzTable: [],
mutipID:[], mutipID: [],
bcpID:[], bcpID: [],
equipmentTable:[], equipmentTable: [],
listLoading: true, listLoading: true,
dialogVisible: false, dialogVisible: false,
dialogType: "new", dialogType: "new",
zhbcp:[], zhbcp: [],
rule1: { rule1: {
number: [{ required: true, message: "请输入", trigger: "blur" }], number: [{ required: true, message: "请输入", trigger: "blur" }],
}, },
butshow:true,
}; };
}, },
computed: {}, computed: {},
watch: {}, watch: {},
created() { created() {
this.getorderList(); this.getorderList();
}, },
methods: { methods: {
checkPermission, checkPermission,
//订单列表 //订单列表
getorderList() { getorderList() {
this.listLoading = true; this.listLoading = true;
getordertoplan(this.listQuery).then((response) => { getordertoplan(this.listQuery).then((response) => {
@ -287,87 +315,80 @@ export default {
}); });
}, },
//物料计算 //物料计算
handlecount() handlecount() {
{ let _this = this;
this.butshow=true;
let _this=this _this.mutipID = [];
_this.mutipID=[] this.$refs.multipleTable.selection.forEach((item) => {
this.$refs.multipleTable.selection.forEach((item) => { _this.mutipID.push({
_this.mutipID.push({ id: item.product_.id,
"id":item.product_.id, count: item.pgcount,
"count": item.pgcount
}); });
}); });
createresource(this.mutipID).then((res) => { createresource(this.mutipID).then((res) => {
if (res.code >= 200) { if (res.code >= 200) {
this.materialpzTable=res.data; this.materialpzTable = res.data;
this.$message.success("物料计算成功"); this.$message.success("物料计算成功");
} }
}); });
createequip(this.mutipID).then((res) => { createequip(this.mutipID).then((res) => {
if (res.code >= 200) { if (res.code >= 200) {
this.equipmentTable=res.data; this.equipmentTable = res.data;
this.$message.success("成功"); this.$message.success("成功");
} }
}); });
}, },
//半成品折合物料 //半成品折合物料
handlebcpcount(){ handlebcpcount() {
let _this=this let _this = this;
_this.bcpID=[] _this.bcpID = [];
this.$refs.multipleTables.selection.forEach((item) => { this.$refs.multipleTables.selection.forEach((item) => {
_this.bcpID.push({ _this.bcpID.push({
"id":item.id, id: item.id,
"count": item.bcpcount count: item.bcpcount,
}); });
}); });
createConvert(this.bcpID).then((res) => {
if (res.code >= 200) {
this.materialpzTable.forEach((items) => {
_this.zhbcp=[], res.data.forEach((item) => {
createConvert(this.bcpID).then((res) => { if (item.id == items.id) {
if (res.code >= 200) { items.count = items.count - item.count;
this.zhbcp= res.data }
}
}); });
});
}, console.log(this.materialpzTable);
this.butshow=false;
}
});
},
handleclick(scope) {
handleclick(scope){ this.orderID = scope.row.id;
this.orderID = scope.row.id;
this.dialogVisible = true; this.dialogVisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs["Form"].clearValidate(); this.$refs["Form"].clearValidate();
}); });
}, },
async confirm(form) { async confirm(form) {
this.orderplan.start_date = this.value1[0];
this.orderplan.start_date = this.value1[0]; this.orderplan.end_date = this.value1[1];
this.orderplan.end_date = this.value1[1]; this.orderplan.order = this.orderID;
this.orderplan.order = this.orderID
createProductionplan(this.orderplan).then((res) => { createProductionplan(this.orderplan).then((res) => {
if (res.code >= 200) { if (res.code >= 200) {
this.getorderList(); this.getorderList();
this.getplanList(); this.getplanList();
this.dialogVisible = false; this.dialogVisible = false;
this.$message.success("成功"); this.$message.success("成功");
} }
}); });
}, },
}, },
}; };
</script>
</script>