家里的样式
This commit is contained in:
699
src/views/Assembly/QualityInspectionInformationInquiry/index.vue
Normal file
699
src/views/Assembly/QualityInspectionInformationInquiry/index.vue
Normal file
@@ -0,0 +1,699 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<el-row>
|
||||
<span>机床编号:</span>
|
||||
<el-select v-model="machineNumberValue" filterable placeholder="机床编号" size="small" clearable @change="machineChange()">
|
||||
<el-option
|
||||
v-for="item in machineNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
<div style="float: left">{{ item.label }}</div>
|
||||
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<span>组号:</span>
|
||||
<el-select v-model="groupNumberValue" filterable placeholder="组号" size="small" clearable>
|
||||
<el-option
|
||||
v-for="item in groupNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span>零件:</span>
|
||||
<el-input v-model="SpareParts" filterable placeholder="请输入零件名称" style="width: 200px" size="small" clearable/>
|
||||
<span>质检类型:</span>
|
||||
<el-select v-model="QualityTypeValue" filterable placeholder="质检类型" size="small" clearable>
|
||||
<el-option
|
||||
v-for="item in QualityTypeNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 20px">
|
||||
<span class="demonstration">时间区间:</span>
|
||||
<el-date-picker
|
||||
v-model="startTime"
|
||||
value-format="yyyy-MM-dd"
|
||||
size="small"
|
||||
style="width: 160px"
|
||||
type="date"
|
||||
placeholder="选择日期"/>
|
||||
<span class="demonstration">~</span>
|
||||
<el-date-picker
|
||||
v-model="endTime"
|
||||
value-format="yyyy-MM-dd"
|
||||
size="small"
|
||||
style="width: 160px"
|
||||
type="date"
|
||||
placeholder="选择日期"/>
|
||||
<span>质检情况:</span>
|
||||
<el-select v-model="qualityInspectionValue" filterable placeholder="质检情况" size="small" clearable>
|
||||
<el-option
|
||||
v-for="item in qualityInspection"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span>质检人员:</span>
|
||||
<el-select v-model="personNum" filterable placeholder="质检人员" size="small" clearable>
|
||||
<el-option
|
||||
v-for="item in person"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 15px" @click="pageSize=10; pageCurrent= 1;selecttable()">查询</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-download" style="margin-left:10px" @click="exportExcel()">导出</el-button>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<el-table :data="tableData1" border size="mini" highlight-current-row style="width: 100%;margin-top: 15px" height="600px">
|
||||
<el-table-column align="center" label="禁用情况" width="80px">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="parseInt(scope.row.是否禁用)===0||scope.row.是否禁用===''" type="success" size="small" @click="approvalPass(scope.row)">未禁用</el-tag>
|
||||
<el-tag v-if="parseInt(scope.row.是否禁用)===1" type="error" size="small">已禁用</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="机床图号" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="机床名称" align="center" width="160px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="组号" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.组号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件型号" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件名称" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件数量" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规格或材料" align="center" width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.规格或材料 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工序名称" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工艺名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="质检类型" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.质检类型 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="质检人员" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="检验数量" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="不合格数量" align="center" width="90px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.不合格数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="不合格原因" align="center" width="90px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.不合格原因文本 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="处理结果" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.不合格处理文本 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="质检时间" align="center" width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.操作时间 ? scope.row.操作时间.split(' ')[0] : '' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.备注 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="形位" fixed="right" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-popover placement="right" width="500" trigger="click">
|
||||
<el-table :data="gridData" highlight-current-row size="mini">
|
||||
<el-table-column width="50" align="center" type="index" label="序号"/>
|
||||
<el-table-column min-width="150" align="center" label="类别">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.类别 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="100" align="center" label="数值">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.数值 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="100" align="center" label="零件数量">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-button slot="reference" type="success" plain size="mini" icon="el-icon-search" @click="searchTableDetail(1, scope.row.质检流水号)">形位</el-button>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="尺寸" fixed="right" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-popover placement="right" width="500" trigger="click">
|
||||
<el-table :data="gridData" highlight-current-row size="mini">
|
||||
<el-table-column width="50" align="center" type="index" label="序号"/>
|
||||
<el-table-column min-width="150" align="center" label="类别">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.类别 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="100" align="center" label="数值">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.数值 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="100" align="center" label="零件数量">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-button slot="reference" type="success" plain size="mini" icon="el-icon-search" @click="searchTableDetail(2, scope.row.质检流水号)">尺寸</el-button>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="外观" fixed="right" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-popover placement="right" width="500" trigger="click">
|
||||
<el-table :data="gridData" highlight-current-row size="mini">
|
||||
<el-table-column width="50" align="center" type="index" label="序号"/>
|
||||
<el-table-column min-width="150" align="center" label="类别">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.类别 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="100" align="center" label="数值">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.数值 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="100" align="center" label="零件数量">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-button slot="reference" type="success" plain size="mini" icon="el-icon-search" @click="searchTableDetail(3, scope.row.质检流水号)">外观</el-button>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="viewPicture(scope.row)">查看图片</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
v-if="!loading"
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[10, 20, 30, 40, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<h3 align="center">正在加工零件列表</h3>
|
||||
<el-table :data="tableData10" border size="mini" highlight-current-row style="width: 100%;margin-top: 15px" height="475px">
|
||||
<el-table-column label="机床图号" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="机床名称" align="center" width="160px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="组号" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.组号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件图号" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件名称" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件数量" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.批次数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工序名称" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工艺名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工位" align="center" width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.终端编号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作工" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="viewProcedures(scope.row)">查看工序情况</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent1"
|
||||
:page-sizes="[10, 20, 30, 40, 100]"
|
||||
:page-size="pageSize1"
|
||||
:total="total1"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange1"
|
||||
@current-change="handleCurrentChange1"/>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<h3 align="center">待加工零件列表</h3>
|
||||
<el-table :data="tableData20" border size="mini" highlight-current-row style="width: 100%;margin-top: 15px" height="475px">
|
||||
<el-table-column label="机床图号" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="机床名称" align="center" width="160px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="组号" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.组号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件图号" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件名称" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件数量" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.批次数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工序名称" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工艺名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工位" align="center" width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.mes终端编号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作工" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="viewProcedures(scope.row)">查看工序情况</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent2"
|
||||
:page-sizes="[10, 20, 30, 40, 100]"
|
||||
:page-size="pageSize2"
|
||||
:total="total2"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange2"
|
||||
@current-change="handleCurrentChange2"/>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-dialog :visible.sync="dialogFormVisible4" title="工序完成情况" center style="min-height: 300px">
|
||||
<el-row>
|
||||
<span>零件图号:</span>
|
||||
<el-input v-model="SparePartsNumber" style="width: 200px" size="small"/>
|
||||
<span>零件名称:</span>
|
||||
<el-input v-model="SparePartsName" style="width: 200px" size="small"/>
|
||||
</el-row>
|
||||
<el-table
|
||||
:data="tableData5"
|
||||
style="width: 100%;max-height: 400px;margin-top: 20px"
|
||||
size="mini"
|
||||
height="300"
|
||||
highlight-current-row
|
||||
border>
|
||||
<el-table-column align="center" label="工序顺序" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工序顺序 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工艺名称" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工艺名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工艺要求">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工艺要求 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作工">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.员工姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工艺是否完成" width="130">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="parseInt(scope.row.工序状态)===4" type="success" size="small">已完成</el-tag>
|
||||
<el-tag v-if="parseInt(scope.row.工序状态)===5" type="warning" size="small">报废</el-tag>
|
||||
<el-tag v-if="parseInt(scope.row.工序状态)!==4 && parseInt(scope.row.工序状态)!==5" type="primary" size="small">未完成</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工艺是否质检" width="130">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="parseInt(scope.row.是否质检)===1" type="success" size="small">合格</el-tag>
|
||||
<el-tag v-if="parseInt(scope.row.是否质检)===2" type="warning" size="small">不合格</el-tag>
|
||||
<el-tag v-if="parseInt(scope.row.是否质检)!==1 && parseInt(scope.row.是否质检)!==2" type="primary" size="small">未检测</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
<el-dialog :visible.sync="dialogFormVisible" title="图片" center style="" width="1100px">
|
||||
<viewer>
|
||||
<img v-for="url in urls" :key="url" :src="url" lazy style="width: 1000px;height: 700px">
|
||||
</viewer>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { initProject, searchgroup, selecttable, QualityType, searchPic, searchTableDetail, searchData, searchData1, processingStatus, initPerson, Prohibit, selecttable22 } from '@/api/Assembly/QualityInspectionInformationInquiry'
|
||||
import { readFile } from '@/utils/request'
|
||||
// import { mapGetters } from 'vuex'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
machineNumberValue: '',
|
||||
machineNumber: [],
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
urls: [],
|
||||
URL: '',
|
||||
number: '',
|
||||
groupNumberValue: '',
|
||||
groupNumber: [],
|
||||
gridData: [],
|
||||
QualityTypeNumber: [],
|
||||
QualityTypeValue: '',
|
||||
qualityInspectionValue: '',
|
||||
qualityInspection: [
|
||||
{
|
||||
value: 1,
|
||||
label: '合格'
|
||||
}, {
|
||||
value: 2,
|
||||
label: '不合格'
|
||||
}
|
||||
],
|
||||
tableData1: [],
|
||||
tableData10: [],
|
||||
tableData20: [],
|
||||
tableData5: [],
|
||||
SpareParts: '',
|
||||
SparePartsNumber: '',
|
||||
SparePartsName: '',
|
||||
personNum: '',
|
||||
person: [],
|
||||
dialogFormVisible: false,
|
||||
dialogFormVisible4: false,
|
||||
loading: false,
|
||||
total: 0, // 总条数
|
||||
pageSize: 10, // 每页显示条数
|
||||
pageCurrent: 1, // 后台获取页
|
||||
total1: 0, // 总条数
|
||||
pageSize1: 10, // 每页显示条数
|
||||
pageCurrent1: 1, // 后台获取页
|
||||
total2: 0, // 总条数
|
||||
pageSize2: 10, // 每页显示条数
|
||||
pageCurrent2: 1 // 后台获取页
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
mounted() {
|
||||
this.initProject()
|
||||
this.QualityType()
|
||||
this.fetchData()
|
||||
this.fetchData1()
|
||||
},
|
||||
methods: {
|
||||
initProject() {
|
||||
initProject().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.machineNumber.push({
|
||||
label: response.data[i].机床图号,
|
||||
name: response.data[i].项目名称,
|
||||
value: response.data[i].机床流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
QualityType() {
|
||||
QualityType().then(response => {
|
||||
console.log(response.data)
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.QualityTypeNumber.push({
|
||||
label: response.data[i].质检类型,
|
||||
value: response.data[i].质检类型代码
|
||||
})
|
||||
}
|
||||
})
|
||||
initPerson().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.person.push({
|
||||
label: response.data[i].姓名,
|
||||
value: response.data[i].人员编号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
approvalPass(row) {
|
||||
this.$confirm('是否禁用?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
Prohibit(row.质检流水号, row.质检类型代码).then(res => {
|
||||
if (res.data[0].result === '1') {
|
||||
this.$message.success('操作成功')
|
||||
this.selecttable()
|
||||
} else {
|
||||
this.$message.error('操作失败')
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消操作'
|
||||
})
|
||||
})
|
||||
},
|
||||
formatJson(filterVal, jsonData) {
|
||||
return jsonData.map(v => filterVal.map(j => {
|
||||
return v[j]
|
||||
}))
|
||||
},
|
||||
exportExcel() {
|
||||
if (this.machineNumberValue !== '' && this.machineNumberValue !== null) { this.check1 = 1 } else { this.check1 = 0 }
|
||||
if (this.groupNumberValue !== '' && this.groupNumberValue !== null) { this.check2 = 1 } else { this.check2 = 0 }
|
||||
if (this.SpareParts !== '' && this.SpareParts !== null) { this.check3 = 1 } else { this.check3 = 0 }
|
||||
if (this.QualityTypeValue !== '' && this.QualityTypeValue !== null) { this.check4 = 1 } else { this.check4 = 0 }
|
||||
if (this.startTime !== '' && this.startTime !== null) { this.check5 = 1 } else { this.check5 = 0 }
|
||||
if (this.endTime !== '' && this.endTime !== null) { this.check6 = 1 } else { this.check6 = 0 }
|
||||
if (this.qualityInspectionValue !== '' && this.qualityInspectionValue !== null) { this.check7 = 1 } else { this.check7 = 0 }
|
||||
if (this.personNum !== '' && this.personNum !== null) { this.check8 = 1 } else { this.check8 = 0 }
|
||||
selecttable22(this.check1, this.machineNumberValue, this.check2, this.groupNumberValue, this.check3, this.SpareParts, this.check4, this.QualityTypeValue, this.check5, this.startTime, this.check6, this.endTime, this.check7, this.qualityInspectionValue, this.check8, this.personNum).then(response => {
|
||||
import('@/vendor/Export2Excel').then(excel => {
|
||||
const tHeader = ['是否禁用', '机床图号', '机床名称', '组号', '零件图号', '零件名称', '零件数量', '规格或材料', '工序名称', '质检类型', '检验数量', '不合格数量', '不合格原因', '处理结果', '质检时间', '备注']
|
||||
const filterVal = ['是否禁用', '机床图号', '机床名称', '组号', '零件图号', '零件名称', '零件数量', '规格或材料', '工艺名称', '质检类型', '数量', '不合格数量', '不合格原因文本', '不合格处理文本', '操作时间', '备注']
|
||||
const list = response.data
|
||||
const data = this.formatJson(filterVal, list)
|
||||
excel.export_json_to_excel({
|
||||
header: tHeader,
|
||||
data,
|
||||
filename: '质检情况表',
|
||||
autoWidth: true,
|
||||
bookType: 'xlsx'
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
fetchData() {
|
||||
searchData(this.pageSize1, this.pageCurrent1).then(response => {
|
||||
this.tableData10 = response.data.rows
|
||||
this.total1 = response.data.total
|
||||
})
|
||||
},
|
||||
fetchData1() {
|
||||
searchData1(this.pageSize2, this.pageCurrent2).then(response => {
|
||||
console.log(response)
|
||||
this.tableData20 = response.data.rows
|
||||
this.total2 = response.data.total
|
||||
})
|
||||
},
|
||||
machineChange() {
|
||||
this.groupNumberValue = ''
|
||||
this.groupNumber = []
|
||||
searchgroup(this.machineNumberValue).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.groupNumber.push({
|
||||
label: response.data[i].组号,
|
||||
value: response.data[i].组件流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
searchTableDetail(type, num) {
|
||||
searchTableDetail(type, num).then(response => {
|
||||
this.gridData = response.data
|
||||
})
|
||||
console.log(type)
|
||||
},
|
||||
selecttable() {
|
||||
this.tableData1 = []
|
||||
if (this.machineNumberValue !== '' && this.machineNumberValue !== null) { this.check1 = 1 } else { this.check1 = 0 }
|
||||
if (this.groupNumberValue !== '' && this.groupNumberValue !== null) { this.check2 = 1 } else { this.check2 = 0 }
|
||||
if (this.SpareParts !== '' && this.SpareParts !== null) { this.check3 = 1 } else { this.check3 = 0 }
|
||||
if (this.QualityTypeValue !== '' && this.QualityTypeValue !== null) { this.check4 = 1 } else { this.check4 = 0 }
|
||||
if (this.startTime !== '' && this.startTime !== null) { this.check5 = 1 } else { this.check5 = 0 }
|
||||
if (this.endTime !== '' && this.endTime !== null) { this.check6 = 1 } else { this.check6 = 0 }
|
||||
if (this.qualityInspectionValue !== '' && this.qualityInspectionValue !== null) { this.check7 = 1 } else { this.check7 = 0 }
|
||||
if (this.personNum !== '' && this.personNum !== null) { this.check8 = 1 } else { this.check8 = 0 }
|
||||
selecttable(this.check1, this.machineNumberValue, this.check2, this.groupNumberValue, this.check3, this.SpareParts, this.check4, this.QualityTypeValue, this.check5, this.startTime, this.check6, this.endTime, this.check7, this.qualityInspectionValue, this.check8, this.personNum, this.pageCurrent, this.pageSize).then(response => {
|
||||
console.log(response.data.rows, 111)
|
||||
this.tableData1 = response.data.rows
|
||||
this.loading = false
|
||||
this.total = response.data.total
|
||||
console.log(this.tableData1)
|
||||
})
|
||||
},
|
||||
viewPicture(row) {
|
||||
this.dialogFormVisible = true
|
||||
console.log(row)
|
||||
searchPic(row.质检流水号).then(response => {
|
||||
console.log(response.data, 222)
|
||||
this.urls = []
|
||||
// this.URL = readFile + response.data[0].文件标识 + '.' + response.data[0].文件后缀
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.urls.push(readFile + response.data[i].文件标识 + '.' + response.data[i].文件后缀)
|
||||
}
|
||||
})
|
||||
},
|
||||
viewProcedures(row) {
|
||||
this.dialogFormVisible4 = true
|
||||
this.SparePartsNumber = row.零件图号
|
||||
this.SparePartsName = row.零件名称
|
||||
processingStatus(row.工艺计划流水号).then(response => {
|
||||
this.tableData5 = response.data
|
||||
})
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.selecttable()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.selecttable()
|
||||
},
|
||||
handleSizeChange1(val) {
|
||||
this.pageCurrent1 = 1
|
||||
this.pageSize1 = val
|
||||
this.fetchData()
|
||||
},
|
||||
handleCurrentChange1(val) {
|
||||
this.pageCurrent1 = val
|
||||
this.fetchData()
|
||||
},
|
||||
handleSizeChange2(val) {
|
||||
this.pageCurrent2 = 1
|
||||
this.pageSize2 = val
|
||||
this.fetchData1()
|
||||
},
|
||||
handleCurrentChange2(val) {
|
||||
this.pageCurrent2 = val
|
||||
this.fetchData1()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user