This commit is contained in:
shilixia 2021-12-22 09:46:15 +08:00
parent 6e1d5d93b5
commit feffb4eaca
4 changed files with 392 additions and 271 deletions

View File

@ -298,11 +298,11 @@ export function testInit(data) {
}
//不合格半成品报废
export function scrap(id) {
export function scrap(id,data) {
return request({
url: `/wpm/wproduct/${id}/scrap/`,
method: 'post',
data
})
}

View File

@ -43,6 +43,11 @@
@click="checkRecord(scope,'1')"
>检验记录
</el-link>
<el-link
v-if="checkPermission(['warehouse_update'])"
@click="handleScrapbcp(scope)"
>报废
</el-link>
</template>
</el-table-column>
</el-table>
@ -53,6 +58,32 @@
:limit.sync="listQuery.page_size"
@pagination="getList"
/>
<el-dialog title="半成品报废" :close-on-click-modal="false" :visible.sync="dialogFormVisiblebcp">
<el-form :model="formbcp">
<el-form-item label="甩片原因" :label-width="formLabelWidth">
<el-select
style="width: 80%"
v-model="formbcp.scrap_reason"
placeholder="请甩片原因"
>
<el-option
v-for="item in scrapreason"
:key="item.lable"
:label="item.lable"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisiblebcp = false"> </el-button>
<el-button type="primary" @click="scrapesubmit"> </el-button>
</div>
</el-dialog>
</el-card>
</el-tab-pane>
<el-tab-pane label="复检半成品">
@ -491,6 +522,7 @@
data() {
return {
testitem: defaultetestitem,
formbcp:{},
form: {remark: "", warehouse: ""},
wproductList: {
count: 0,
@ -556,6 +588,12 @@
label: "不合格",
},
],
scrapreason: [
{ lable: "气泡", value: 10 },
{ lable: "破点", value: 20 },
{ lable: "划伤", value: 30 },
{ lable: "其他", value: 40 },
],
recordList: [],
options: [],
listLoading: true,
@ -571,6 +609,7 @@
page: 0,
},
recordVisible:false,
dialogFormVisiblebcp:false,
innerIndex:null,
origintest:null,
mutipID: [],
@ -612,6 +651,25 @@
this.listLoading = false;
});
},
//待检半成品报废
handleScrapbcp(scope){
this.dialogFormVisiblebcp=true;
this.bcpbf=scope.row.id;
},
//确定报废半成品
scrapesubmit(){
console.log(this.formbcp);
scrap(this.bcpbf,this.formbcp).then((response) => {
if (response.data) {
this.$message.success("该半成品已报废!");
this.dialogFormVisiblebcp=false;
this.getList();
}
});
},
//复检半成品列表
getList2() {
this.listQuery2.act_state = 6;

View File

@ -147,19 +147,23 @@ handleoperation(scope)
});
},
getList(){
getoperationList(this.listQuery).then((response) => {
if (response.data) {
this.operationList = response.data;
}
});
},
//选项卡切换
handleClick(tab) {
this.process = tab.name;
this.listQuery.step__process = tab.name;
this.steps = [];
getoperationList(this.listQuery).then((response) => {
if (response.data) {
this.operationList = response.data;
}
this.listLoading = false;
});
this.getList();
},
//操作记录删除
handleDelete(scope) {
this.$confirm("确认该操作删除?", "警告", {

View File

@ -20,15 +20,17 @@
<el-table-column type="index" width="50" />
<el-table-column label="任务编号">
<template slot-scope="scope">{{
scope.row.number
}}</template>
<template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column>
<el-table-column label="产品名称">
<template slot-scope="scope">{{ scope.row.product_.name }}</template>
<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>
<template slot-scope="scope">{{
scope.row.product_.specification
}}</template>
</el-table-column>
<el-table-column label="生产主产品" width="140">
<template slot-scope="scope">{{
@ -66,10 +68,8 @@
</el-table-column>
<el-table-column label="状态">
<template slot-scope="scope">
{{
state_[scope.row.state]
}}</template>
{{ state_[scope.row.state] }}</template
>
</el-table-column>
<el-table-column label="领料状态" width="100">
<template slot-scope="scope">
@ -80,9 +80,7 @@
<el-table-column label="计划/生产/合格">
<template slot-scope="scope"
>{{
scope.row.main_count
}}/{{ scope.row.main_count_real }}/{{
>{{ scope.row.main_count }}/{{ scope.row.main_count_real }}/{{
scope.row.main_count_ok
}}</template
>
@ -90,10 +88,16 @@
<el-table-column align="center" label="操作" width="130px">
<template slot-scope="scope">
<el-link type="success" v-if="scope.row.is_picked==false" @click="handleNeed(scope)"
<el-link
type="success"
v-if="scope.row.is_picked == false"
@click="handleNeed(scope)"
>领料</el-link
>
<el-link type="success" v-if="scope.row.is_picked" @click="handleNeed(scope)"
<el-link
type="success"
v-if="scope.row.is_picked"
@click="handleNeed(scope)"
>继续领料</el-link
>
<el-link type="primary" @click="handlepick(scope)"
@ -111,7 +115,6 @@
/>
<el-row :gutter="2">
<el-col :span="12">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>半成品</span>
@ -132,6 +135,14 @@
style="float: right"
>显示全部</el-button
>
<el-button
type="primary"
@click="handleScrapbcp()"
id="scrap"
style="float: right; display: none"
>报废</el-button
>
<el-table
:data="wproductData"
@selection-change="handleSelectionChange"
@ -144,7 +155,9 @@
<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.subproduction_plan_.number}}</template>
<template slot-scope="scope">{{
scope.row.subproduction_plan_.number
}}</template>
</el-table-column>
<el-table-column label="玻璃编号">
@ -168,14 +181,17 @@
}}</template>
</el-table-column>
<el-table-column label="更新时间">
<template slot-scope="scope">{{
scope.row.update_time
}}</template>
</el-table-column>
</el-table>
</el-card>
</el-col>
<el-col :span="12">
<el-card class="box-card">
@ -218,9 +234,39 @@
</el-row>
</el-tab-pane>
</el-tabs>
<el-dialog title="领半成品" :close-on-click-modal="false" :visible.sync="dialogTableVisiblepick">
<el-dialog
title="半成品报废"
:close-on-click-modal="false"
:visible.sync="dialogFormVisiblebcp"
>
<el-form :model="formbcp">
<el-form-item label="甩片原因" :label-width="formLabelWidth">
<el-select
style="width: 80%"
v-model="formbcp.scrap_reason"
placeholder="请选择仓库"
>
<el-option
v-for="item in scrapreason"
:key="item.lable"
:label="item.lable"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisiblebcp = false"> </el-button>
<el-button type="primary" @click="scrapesubmit"> </el-button>
</div>
</el-dialog>
<el-dialog
title="领半成品"
:close-on-click-modal="false"
:visible.sync="dialogTableVisiblepick"
>
<el-table :data="bcplist" style="width: 100%">
<el-table-column prop="material_.name" label="物料名称">
</el-table-column>
<el-table-column prop="material_.number" label="物料编号">
@ -229,27 +275,20 @@
</el-table-column>
<el-table-column prop="material_.unit" label="物料单位">
</el-table-column>
<el-table-column prop="count" label="所需物料数量">
</el-table-column>
<el-table-column prop="count" label="所需物料数量"> </el-table-column>
<el-table-column prop="count_real" label="已领物料数量">
</el-table-column>
<el-table-column prop="count_pick" label="实际产出/消耗">
</el-table-column>
<el-table-column
align="center"
label="操作"
>
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-link
v-if="checkPermission(['material_update'])"
@click="handleReceive(scope)"
>领半成品</el-link >
>领半成品</el-link
>
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogTableVisiblepick = false"> </el-button>
@ -257,9 +296,12 @@
</div>
</el-dialog>
<el-dialog title="半成品列表" :close-on-click-modal="false" :visible.sync="dialogTableVisiblepicks">
<el-dialog
title="半成品列表"
:close-on-click-modal="false"
:visible.sync="dialogTableVisiblepicks"
>
<el-table
:data="wproductslist"
border
fit
@ -275,20 +317,18 @@
<template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column>
<el-table-column label="玻璃状态">
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
</el-table-column>
<el-table-column label="所属子计划">
<template slot-scope="scope">{{ scope.row.subproduction_plan }}</template>
<template slot-scope="scope">{{
scope.row.subproduction_plan
}}</template>
</el-table-column>
<el-table-column label="备注">
<template slot-scope="scope">{{ scope.row.remark }}</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogTableVisiblepicks = false"> </el-button>
@ -296,14 +336,23 @@
</div>
</el-dialog>
<el-dialog :visible.sync="dialogVisiblenw" :close-on-click-modal="false" width="80%" title="领料">
<el-dialog
:visible.sync="dialogVisiblenw"
:close-on-click-modal="false"
width="80%"
title="领料"
>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>生产所需领料表</span>
</div>
<template>
<el-table :data="needwl" highlight-current-row height="300" style="width: 100%">
<el-table
:data="needwl"
highlight-current-row
height="300"
style="width: 100%"
>
<el-table-column prop="material_.name" label="物料名称">
</el-table-column>
<el-table-column prop="material_.number" label="物料编号">
@ -330,8 +379,12 @@
>
</div>
<template>
<el-table :data="havewl" highlight-current-row height="300" style="width: 100%" >
<el-table
:data="havewl"
highlight-current-row
height="300"
style="width: 100%"
>
<el-table-column prop="batch" label="物料批次"> </el-table-column>
<el-table-column prop="material_.name" label="物料名称">
</el-table-column>
@ -340,7 +393,11 @@
<el-table-column prop="count" label="物料总数量"> </el-table-column>
<el-table-column label="输入领料数量" width="140px">
<template slot-scope="scope">
<el-form :model="scope.row" v-if="scope.row.material_.type!=2" widht="100px">
<el-form
:model="scope.row"
v-if="scope.row.material_.type != 2"
widht="100px"
>
<el-form-item size="mini">
<el-input-number
v-model="scope.row.pick_count"
@ -363,7 +420,6 @@
<template slot-scope="scope">
<el-link
v-if="scope.row.material_.type == 2"
@click="handlewproduct(scope)"
>选择半成品</el-link
>
@ -373,9 +429,12 @@
</template>
</el-card>
</el-dialog>
<el-dialog title="半成品列表" :close-on-click-modal="false" :visible.sync="dialogTableVisible">
<el-dialog
title="半成品列表"
:close-on-click-modal="false"
:visible.sync="dialogTableVisible"
>
<el-table
:data="iproductData"
border
fit
@ -398,10 +457,10 @@
</el-table-column>
<el-table-column label="所在仓库">
<template slot-scope="scope">{{ scope.row.warehouse_.name }}</template>
<template slot-scope="scope">{{
scope.row.warehouse_.name
}}</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogTableVisible = false"> </el-button>
@ -436,7 +495,6 @@
<span>消耗物料表</span>
<el-table :data="input" border style="width: 100%">
<el-table-column
prop="subproduction_plan"
label="子计划编号"
@ -651,6 +709,7 @@
<el-button type="primary" @click="submint()">确认</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
@ -665,10 +724,10 @@ import {
getsubplanList,
getpickhalfList,
createpickhalf,
createOperation
createOperation,
} from "@/api/wpm";
import { getiproductList } from "@/api/inm";
import { createWork } from "@/api/wpm";
import { scrap } from "@/api/wpm";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaulteneed = {};
export default {
@ -751,6 +810,14 @@ export default {
workData: {},
bcplist: "",
wproductslist: "",
formbcp: {},
dialogFormVisiblebcp: false,
scrapreason: [
{ lable: "气泡", value: 10 },
{ lable: "破点", value: 20 },
{ lable: "划伤", value: 30 },
{ lable: "其他", value: 40 },
],
};
},
process: "",
@ -766,12 +833,14 @@ export default {
handleClick(tab) {
this.process = tab.name;
this.listQuery.process = tab.name;
if (tab.name == 1) {
document.getElementById("scrap").style.display = "block";
}
this.steps = [];
getsubplanList(this.listQuery).then((response) => {
if (response.data) {
this.subproductionplanList = response.data;
}
});
//子工序列表
@ -780,7 +849,6 @@ export default {
if (response.data) {
this.steps = response.data;
}
});
//车间物料表
this.getwmaterialLists();
@ -789,8 +857,7 @@ export default {
},
//车间物料
getwmaterialLists()
{
getwmaterialLists() {
getwmaterialList({
subproduction_plan__process: this.process,
page: 0,
@ -798,7 +865,25 @@ export default {
if (response.data) {
this.wmaterialList = response.data;
}
});
},
//待检半成品报废
handleScrapbcp() {
this.dialogFormVisiblebcp = true;
},
//确定报废半成品
scrapesubmit() {
console.log(this.formbcp);
scrap(this.wpID, this.formbcp).then((response) => {
if (response.code==200) {
this.$message.success("该半成品已报废!");
this.dialogFormVisiblebcp = false;
// 半成品表
this.getwproductLists();
}
});
},
@ -816,9 +901,7 @@ export default {
if (response.data) {
this.wmaterialList = response.data;
}
});
},
//大工序工序渲染
getProcessList() {
@ -826,7 +909,6 @@ export default {
if (response.data) {
this.processOption = response.data;
}
});
},
@ -839,7 +921,6 @@ export default {
if (response.data) {
this.subproductionplanList = response.data;
}
});
//车间物料表
this.getwmaterialLists();
@ -847,7 +928,6 @@ export default {
this.getwproductLists();
},
//大工序下子工序产出的半成品
getwproductLists() {
this.wproductdata.page = 0;
@ -864,17 +944,18 @@ export default {
},
//调出该批次该仓库的所有半成品
handlewproduct(scope) {
this.dialogTableVisible = true;
this.pcId = scope.row.id;
getiproductList({page:0,material:scope.row.material,warehouse:scope.row.warehouse,batch:scope.row.batch}).then((response) => {
getiproductList({
page: 0,
material: scope.row.material,
warehouse: scope.row.warehouse,
batch: scope.row.batch,
}).then((response) => {
if (response.data) {
this.iproductData = response.data;
}
});
},
//勾选半成品
handleSelectionChanges(val) {
@ -885,17 +966,12 @@ export default {
},
//提交半成品
iproductsSubmit() {
this.dialogTableVisible = false;
this.havewl.forEach((item) => {
if(item.id== this.pcId)
{
if (item.id == this.pcId) {
item.iproducts = this.iproducts;
}
});
},
//领料
@ -915,10 +991,8 @@ export default {
handlePick() {
this.pickData.subproduction_plan = this.id;
this.pickData.picks = this.havewl;
createPick(this.pickData).then((res) => {
if (res.code >= 200) {
this.dialogVisiblenw = false;
@ -931,18 +1005,18 @@ export default {
}
});
//半成品
getwproductList({page:0,step__process:this.process}).then((response) => {
getwproductList({ page: 0, step__process: this.process }).then(
(response) => {
if (response.data) {
this.wproductData = response.data;
console.log( this.wproductData)
console.log(this.wproductData);
}
});
}
);
},
//领半成品
handlepick(scope) {
this.dialogTableVisiblepick = true;
this.spid = scope.row.id;
getpickhalfList(this.spid).then((res) => {
@ -955,7 +1029,11 @@ handlepick(scope){
handleReceive(scope) {
this.dialogTableVisiblepicks = true;
this.bcpxlID = scope.row.id;
getwproductList({material:scope.row.material,act_state:30,page:0}).then((res) => {
getwproductList({
material: scope.row.material,
act_state: 30,
page: 0,
}).then((res) => {
if (res.code >= 200) {
this.wproductslist = res.data;
}
@ -967,34 +1045,24 @@ handleReceive(scope){
this.bcpproducts.push(item.id);
});
},
wproductSubmit()
{
wproductSubmit() {
this.dialogTableVisiblepicks = false;
this.bcplist.forEach((item) => {
if(item.id == this.bcpxlID)
{
if (item.id == this.bcpxlID) {
item.iproducts = this.bcpproducts;
}
});
},
//提交领的半成品
bcpllSubmit()
{
bcpllSubmit() {
this.bcplists = []; //新的半成品表
this.bcplist.forEach((item) => {
this.bcplists.push({
"id":item.id,
"wproducts": item.iproducts
id: item.id,
wproducts: item.iproducts,
});
});
console.log(this.bcplists);
createpickhalf(this.spid, this.bcplists).then((res) => {
@ -1007,13 +1075,8 @@ wproductSubmit()
this.getwproductLists();
}
});
},
prev() {
--this.values;
if (this.values < 0) this.values = 0;
@ -1039,8 +1102,7 @@ wproductSubmit()
createOperation(this.Operation).then((res) => {
if (res.code >= 200) {
this.$message.success("操作记录创建成功!");
this.$router.push({name: "operation", params: { id: item.id }, })
this.$router.push({ name: "operation", params: { id: item.id } });
}
});
},
@ -1064,7 +1126,6 @@ wproductSubmit()
});
});
this.workData.step = this.step;
this.workData.wproducts = this.wproducts;
this.workData.input = this.input;
@ -1076,7 +1137,6 @@ wproductSubmit()
}
console.log(this.remark);
submitWork(this.workData).then((res) => {
if (res.code >= 200) {
this.dialogVisiblework = false;
@ -1085,7 +1145,6 @@ wproductSubmit()
}
});
},
},
};
</script>