This commit is contained in:
shilixia 2021-12-30 14:17:29 +08:00
parent 0ddff915b8
commit 5c4c5c7688
3 changed files with 219 additions and 8 deletions

View File

@ -360,6 +360,14 @@ export const asyncRoutes = [
hidden: true
}
,
{
path: 'wproduct/:id',
name: 'wproduct',
component: () => import('@/views/qm/wproduct'),
meta: { title: '工序玻璃', perms: ['vendor_manage'] },
hidden: true
}
,
{
path: 'taskrecordfrom/:id',
name: 'taskrecordfrom',

View File

@ -1,11 +1,11 @@
<template>
<div class="app-container">
<el-card style="margin-top: 2px">
<el-descriptions title="任务详情" :column="5" border>
<el-descriptions title="任务详情" :column="5" border style="margin-bottom: 20px">
<el-descriptions-item label="任务编号">{{productionplan.number}}</el-descriptions-item>
<el-descriptions-item label="产品名称">{{productionplan.product_.name}}</el-descriptions-item>
<el-descriptions-item label="规格型号">{{productionplan.product_.specification}}</el-descriptions-item>
<el-descriptions-item label="生产状态">生产状态没有</el-descriptions-item>
<el-descriptions-item label="产品名称" v-if="productionplan.product_">{{productionplan.product_.name}}</el-descriptions-item>
<el-descriptions-item label="规格型号" v-if="productionplan.product_">{{productionplan.product_.specification}}</el-descriptions-item>
<el-descriptions-item label="生产状态">{{state_[productionplan.state]}}</el-descriptions-item>
<el-descriptions-item label="不合格品数量">不合格数没有</el-descriptions-item>
</el-descriptions>
@ -17,7 +17,7 @@
fit
stripe
style="width: 100%"
height="300"
height="500"
>
<el-table-column type="index" width="50" />
@ -58,6 +58,52 @@
</el-tab-pane>
<el-tab-pane label="工序" name="2" >
<el-table
:data="process_json"
border
fit
stripe
style="width: 100%"
height="500"
>
<el-table-column type="index" width="50" />
<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.count_real }}</template>
</el-table-column>
<el-table-column label="合格数量" >
<template slot-scope="scope" >{{ scope.row.count_ok }}</template>
</el-table-column>
<el-table-column label="不合格数量" >
<template slot-scope="scope" >{{ scope.row.count_notok }}</template>
</el-table-column>
<el-table-column
align="center"
label="过程记录"
width="220px"
>
<template slot-scope="scope">
<el-link
v-if="checkPermission(['material_delete'])"
type="primary"
@click="handleprocess(scope)"
>查看</el-link
>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
</el-card>
@ -69,7 +115,7 @@
</template>
<script>
import { getProductionplan } from "@/api/pm";
import { getProductionplan,getsubproductionplanList } from "@/api/pm";
import { getwproductList} from "@/api/wpm";
import checkPermission from "@/utils/permission";
@ -80,9 +126,23 @@ export default {
components: { Pagination },
data() {
return {
productionplan:"",
productionplan:{
number:""
},
activeName:"1",
wproduct:"",
wproduct:[],
subproductionplanList: "",
listQuery: {
page: 1,
page_size: 20,
},
state_:{
10:'制定中',
20:'已下达',
30:'已接受',
40:'生产中',
50:'已完成',
60:'军检完成'},
actstate_: {
6: "待复检",
10: "操作进行中",
@ -95,6 +155,8 @@ export default {
26: "待夹层检验",
70: "报废",
},
process_json:null,
productionplanID:null,
};
},
computed: {},
@ -102,7 +164,9 @@ export default {
created() {
this.id = this.$route.params.id;
this.getList();
this.getspList();
this.getwproductList();
},
methods: {
checkPermission,
@ -111,9 +175,30 @@ export default {
getProductionplan(this.id).then((response) => {
if (response.data) {
this.productionplan = response.data;
this.productionplanID=response.data.id;
console.log(response.data.process_json);
let process_json = [];
for(let item in response.data.process_json){
let obj = new Object();
obj = response.data.process_json[item];
process_json.push(obj)
}
console.log(process_json);
this.process_json= process_json;
}
});
},
getspList() {
getsubproductionplanList({page:0,production_plan:this.id}).then((response) => {
if (response.data) {
this.subproductionplanList = response.data;
}
});
},
getwproductList()
{
@ -129,6 +214,12 @@ export default {
this.$router.push({name: "taskrecordfrom", params: { id: scope.row.id }, })
},
//查看工序对应的玻璃
handleprocess (scope){
this.$router.push({name: "wproduct", params: { id: scope.row.process,productionplanID:this.productionplanID } })
}
},
};

View File

@ -0,0 +1,112 @@
<template>
<div class="app-container">
<el-card>
<el-table
:data="wproduct"
border
fit
stripe
style="width: 100%"
height="500"
>
<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.step_.name
}}</template>
</el-table-column>
<el-table-column label="状态" >
<template slot-scope="scope">{{
actstate_[scope.row.act_state]
}}</template>
</el-table-column>
<el-table-column
align="center"
label="过程记录"
width="220px"
>
<template slot-scope="scope">
<el-link
v-if="checkPermission(['material_delete'])"
type="primary"
@click="handleoption(scope)"
>查看</el-link
>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
import { getwproductList} from "@/api/wpm";
import checkPermission from "@/utils/permission";
import { genTree } from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
export default {
components: { Pagination },
data() {
return {
wproduct: "",
actstate_: {
6: "待复检",
10: "操作进行中",
20: "待检验",
30: "已合格",
40: "库存中",
50: "不合格",
60: "待成品检验",
8: "操作准备中",
26: "待夹层检验",
70: "报废",
},
};
},
computed: {},
watch: {},
created() {
this.id = this.$route.params.id;
this.productionplanID = this.$route.params.productionplanID;
this.getList();
console.log(this.productionplanID);
},
methods: {
checkPermission,
//半成品列表
getList() {
getwproductList({production_plan:this.productionplanID,step__process:this.id,page:0}).then((response) => {
if (response.data) {
this.wproduct= response.data;
}
});
},
//查看该玻璃检验记录表
handleoption(scope){
this.$router.push({name: "taskrecordfrom", params: { id: scope.row.id }, })
},
},
};
</script>