hberp/hb_client/src/views/qm/unproduct.vue

443 lines
15 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div class="app-container">
<el-card style="margin-top: 2px">
<el-tabs v-model="activeName" type="card">
<el-tab-pane label="成品不合格" name="1">
<el-table
v-loading="listLoading"
:data="wproductList.results"
border
fit
stripe
highlight-current-row
height="100"
v-el-height-adaptive-table="{bottomOffset: 42}"
>
<el-table-column type="index" label="序号" 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" v-if="scope.row.subproduction_plan_">
{{ scope.row.subproduction_plan_.number}}
</template>
</el-table-column>
<el-table-column label="产品名称" min-width="100" show-overflow-tooltip>
<template slot-scope="scope" v-if="scope.row.material_">{{ scope.row.material_.name }}</template>
</el-table-column>
<el-table-column label="型号规格">
<template slot-scope="scope" v-if="scope.row.material_">{{ scope.row.material_.specification }}</template>
</el-table-column>
<el-table-column label="军检结论">
<template slot-scope="scope">
<el-tag v-if="scope.row.is_mtestok==false">不合格</el-tag>
<el-tag v-if="scope.row.is_mtestok==true">合格</el-tag>
</template>
</el-table-column>
<el-table-column label="仓库">
<template slot-scope="scope" v-if="scope.row.warehouse_">{{ scope.row.warehouse_.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">{{ 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(['warehouse_update'])&&scope.row.act_state==30&&scope.row.is_mtested==false"
@click="handleMtest(scope)"
>军检
</el-link>
<el-link
@click="checkRecord(scope)"
>检验记录
</el-link>
</template>
</el-table-column>
</el-table>
<pagination
v-show="wproductList.count > 0"
:total="wproductList.count"
:page.sync="listQuery.page"
:limit.sync="listQuery.page_size"
@pagination="getList"
/>
</el-tab-pane>
<el-tab-pane label="过程不合格品" name="2">
<el-table
:data="wproductticket.results"
border
fit
stripe
highlight-current-row
height="100"
v-el-height-adaptive-table="{bottomOffset: 42}"
>
<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" v-if="scope.row.order_">
{{scope.row.order_.number}}
</template>
</el-table-column>
<el-table-column label="产品名称" min-width="120" show-overflow-tooltip>
<template slot-scope="scope" v-if="scope.row.product_">
{{scope.row.product_.name}}
</template>
</el-table-column>
<el-table-column label="规格型号">
<template slot-scope="scope" v-if="scope.row.product_">
{{scope.row.product_.specification}}
</template>
</el-table-column>
<el-table-column label="责任工序">
<template slot-scope="scope" v-if="scope.row.resp_process_">
{{scope.row.resp_process_.name}}
</template>
</el-table-column>
<el-table-column label="处理结果">
<template slot-scope="scope">
{{decision_[scope.row.decision]}}
</template>
</el-table-column>
<el-table-column label="创建时间">
<template slot-scope="scope">
{{scope.row.create_time}}
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-link
v-if="checkPermission(['material_update'])"
type="primary"
@click="handledetailbhg(scope)"
>
查看
</el-link>
</template>
</el-table-column>
</el-table>
<pagination
v-show="wproductticket.count > 0"
:total="wproductticket.count"
:page.sync="listQuery2.page"
:limit.sync="listQuery2.page_size"
@pagination="getList2"
/>
</el-tab-pane>
<el-tab-pane label="入厂不合格" name="4">
<el-table
:data="fifodetailList4.results"
border
fit
stripe
highlight-current-row
height="100"
v-el-height-adaptive-table="{bottomOffset: 42}"
>
<el-table-column type="index" width="50"/>
<el-table-column label="物料批次">
<template slot-scope="scope">{{ scope.row.batch }}</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.material_.specification }}
</template>
</el-table-column>
<el-table-column label="物料单位">
<template slot-scope="scope">{{ scope.row.material_.unit }}</template>
</el-table-column>
<el-table-column label="文件">
<template slot-scope="scope" v-if="scope.row.files">
<div v-for="item in scope.row.files_" v-bind:key="item.id">
<el-link :href="item.path" target="_blank" type="primary">{{item.name}}</el-link>
</div>
</template>
</el-table-column>
<el-table-column label="是否需要复验">
<template slot-scope="scope">
<el-tag v-if="scope.row.need_test == false"></el-tag>
<el-tag v-else></el-tag>
</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="scope.row.need_test&&scope.row.test.length>0"
type="primary"
@click="handleRecord(scope)"
>
复验记录
</el-link>
<el-link
v-if="scope.row.test.length===0"
type="info"
disabled
>
复验记录
</el-link>
</template>
</el-table-column>
</el-table>
<pagination
v-show="fifodetailList4.count > 0"
:total="fifodetailList4.count"
:page.sync="listQuery4.page"
:limit.sync="listQuery4.page_size"
@pagination="getList4"
/>
</el-tab-pane>
</el-tabs>
</el-card>
<!--检验记录-->
<el-dialog
title="复检记录"
:close-on-click-modal="false"
:visible.sync="limitedCheckRecord"
>
<el-table
:data="recordList"
border
height="400"
>
<el-table-column type="index" width="50"/>
<el-table-column label="表单名称">
<template slot-scope="scope">{{ scope.row.form_.name }}</template>
</el-table-column>
<el-table-column label="检查类型">
入场检验
</el-table-column>
<el-table-column label="操作人">
<template slot-scope="scope">{{ scope.row.create_by_.name }}</template>
</el-table-column>
<el-table-column label="操作时间">
<template slot-scope="scope">
<span>{{scope.row.update_time.substring(0,scope.row.update_time.length-3)}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-link
type="primary"
@click="handleRecordDetail(scope)"
>
查看
</el-link>
<!--<el-link @click="delTestRecord(scope)">
删除
</el-link>-->
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button @click="limitedCheckRecord = false"> </el-button>
<el-button type="primary" @click="limitedCheckRecord = false"> </el-button>
</div>
</el-dialog>
<!--已完成检查表查看-->
<el-dialog
:title="formName"
:visible.sync="recordFinishedVisible"
:close-on-click-modal="false"
>
<el-row>
<el-col :span="12">
<div class="items">
<span class="itemLabel">操作人</span>
<span>{{create_by_}}</span>
</div>
</el-col>
<el-col :span="12">
<div class="items">
<span class="itemLabel">操作时间</span>
<span>{{update_time}}</span>
</div>
</el-col>
<el-col v-for="item in recordFieldList" :key="item.id" :span="12">
<div class="items" v-if="item.field_type!=='draw'&&item.field_value!==null&&item.field_value!==''">
<span class="itemLabel">{{item.field_name}}</span>
<span>{{item.field_value}}</span>
</div>
</el-col>
<el-col v-for="item in recordFieldList" :key="item.id" :span="24">
<div class="items" v-if="item.field_type==='draw'" style="height: 400px">
<span class="itemLabel">{{item.field_name}}</span>
<img style="width: 45%;vertical-align: text-top;" :src="item.field_value"/>
</div>
</el-col>
</el-row>
<el-row>
<div class="items">
<span class="itemLabel">复检结果</span>
<span v-if="is_testOk">合格</span>
<span v-else>不合格</span>
</div>
</el-row>
</el-dialog>
</div>
</template>
<script>
import {getProductionplanList} from "@/api/pm";
import {getwproductticketList, getwproductList} from "@/api/wpm";
import {ticketread} from "@/api/workflow";
import {getfifodetailList} from "@/api/inm";
import {getTestRecord,getTestRecordItem} from "@/api/qm";
import checkPermission from "@/utils/permission";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
export default {
components: {Pagination},
data() {
return {
wproductList: {
count: 0,
},
actstate_: {
6: "待复检",
10: "操作进行中",
20: "待检验",
30: "已合格",
40: "库存中",
50: "不合格",
60: "待成品检验",
8: "操作准备中",
26: "待夹层检验",
70: "报废",
},
listQuery: {
page: 1,
page_size: 20,
},
wproductticket: {
count: 0,
},
listQuery2: {
page: 1,
page_size: 20,
},
recordList:[],
recordFieldList:[],
customfieldList: [],
activeName: "1",
decision_: {
10: "返工",
20: "返修",
30: "报废",
40: "让步接受",
50: "偏离许可",
60: "降级使用",
70: "退回供方",
80: "召回",
},
listQuery4: {
page: 1,
page_size: 20,
},
fifodetailList4: {
count: 0,
},
formName:'',
create_by_:'',
update_time:'',
is_testOk:false,
limitedCheckRecord:false,
recordFinishedVisible:false,
};
},
computed: {},
watch: {},
created() {
this.getList(); //成品不合格
this.getList2(); //过程
this.getList4();//入场不合格
},
methods: {
checkPermission,
//不合格成品
getList() {
this.listLoading = true;
this.listQuery.material__type = 1;
this.listQuery.tag = 'notok';
getwproductList(this.listQuery).then((response) => {
if (response.data) {
this.wproductList = response.data;
}
});
},
//不合格玻璃审批工单列表
getList2() {
getwproductticketList(this.listQuery2).then((response) => {
if (response.data) {
this.wproductticket = response.data;
}
});
},
//不合格玻璃审理单查看
handledetailbhg(scope) {
this.$router.push({name: "ticketDetail", params: {ticketId: scope.row.ticket,workflow:scope.row.workflow}})
},
//入场检验不合格
//不合格物料
getList4() {
this.listLoading = true;
this.listQuery4.fifo__type = 3;
this.listQuery4.is_testok = false;
this.listQuery4.is_tested = true;
getfifodetailList(this.listQuery4).then((response) => {
if (response.data) {
this.fifodetailList4 = response.data;
}
this.listLoading = false;
});
},
//检验记录
handleRecord(scope) {
let that = this;
that.fifo_item = scope.row.id;
that.limitedCheckRecord = true;
getTestRecord({fifo_item: scope.row.id}).then(res => {
if (res.code == 200) {
that.recordList = res.data.results;
} else {
this.$message.error(res.msg);
}
})
},
//点击记录里的查看
handleRecordDetail(scope) {
let that = this;
that.is_testOk = scope.row.is_testok;
that.recordFieldList = [];
that.create_by_ = scope.row.create_by_.name;
that.update_time = scope.row.update_time;
getTestRecordItem(scope.row.id).then((res) => {
if (res.code >= 200) {
that.recordFinishedVisible = true;
that.formName = res.data.form_.name;
that.recordFieldList = res.data.record_data;
}
})
},
},
};
</script>