更新
This commit is contained in:
907
src/views/BasicData/PartsNumberMaintenance/index.vue
Normal file
907
src/views/BasicData/PartsNumberMaintenance/index.vue
Normal file
@@ -0,0 +1,907 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<span>项目名称</span>
|
||||
<el-select v-model="projectValue" placeholder="请选择项目名称" filterable size="small">
|
||||
<el-option
|
||||
v-for="item in project"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
|
||||
<span>机床图号</span>
|
||||
<el-select v-model="machineValue" placeholder="请选择机床图号" filterable size="small">
|
||||
<el-option
|
||||
v-for="item in machine"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
|
||||
<span>组号</span>
|
||||
<el-select v-model="groupValue" placeholder="请选择组号" filterable size="small">
|
||||
<el-option
|
||||
v-for="item in group"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
|
||||
<span>零件图号:</span>
|
||||
<el-input v-model="partNumber" clearable filterable size="small" placeholder="零件图号" style="width: 200px;"/>
|
||||
|
||||
<el-button icon="el-icon-search" type="success" size="small" @click="pageCurrentWB = 1;pageSizeWB = 10;pageCurrent = 1;pageSize = 10;getTableData();pageCurrent1 = 1;pageSize1 = 10;getTable();pageCurrent2 = 1;pageSize2 = 10;getTable1()">查询</el-button>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<div style="font-size: 20px;margin-bottom: 20px">基本件三表数量</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
highlight-current-row
|
||||
border
|
||||
size="mini"
|
||||
style="width: 100%;max-height: 520px"
|
||||
height="320">
|
||||
<el-table-column
|
||||
label="序号"
|
||||
align="center"
|
||||
type="index"
|
||||
width="50"/>
|
||||
<el-table-column
|
||||
label="机床图号"
|
||||
align="center"
|
||||
min-width="150px">
|
||||
<template slot-scope="scope">{{ scope.row.机床图号 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="零件图号"
|
||||
align="center"
|
||||
min-width="200px">
|
||||
<template slot-scope="scope">{{ scope.row.零件图号 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="零件名称"
|
||||
align="center"
|
||||
min-width="100px">
|
||||
<template slot-scope="scope">{{ scope.row.零件名称 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="组号"
|
||||
align="center"
|
||||
min-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">
|
||||
<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 align="center" label="分类码" width="150">
|
||||
<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="整改类型" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.整改类型 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
@click="type=1;handleEdit(scope.row)">编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChanges"
|
||||
@current-change="handleCurrentChanges"/>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<div style="font-size: 20px;margin-bottom: 20px">外购件和标准件三表数量</div>
|
||||
<el-table
|
||||
v-loading="loadingWB"
|
||||
:data="tableDataWB"
|
||||
style="width: 100%"
|
||||
size="mini"
|
||||
height="320"
|
||||
highlight-current-row
|
||||
border>
|
||||
<el-table-column
|
||||
label="序号"
|
||||
align="center"
|
||||
type="index"
|
||||
width="50"/>
|
||||
<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="物料型号">
|
||||
<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 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 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="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.备注 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="标记" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.标记 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
@click="type=1;handleEdit(scope.row)">编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px">
|
||||
<el-pagination
|
||||
:current-page="pageCurrentWB"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSizeWB"
|
||||
:total="totalWB"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChangeWB"
|
||||
@current-change="handleCurrentChangeWB"/>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<div>
|
||||
<div style="font-size: 20px;margin-bottom: 20px">未投产数量</div>
|
||||
<el-table
|
||||
:data="tableData1"
|
||||
border
|
||||
style="width: 100%"
|
||||
height="320">
|
||||
<el-table-column label="零件号" align="center" min-width="220">
|
||||
<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="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件类型名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="200px" fixed="right" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
@click="type=1;handleEdit(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent1"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize1"
|
||||
:total="total1"
|
||||
style="width:50%;display:inline-block;"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange1"
|
||||
@current-change="handleCurrentChange1"/>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<div style="font-size: 20px;margin-bottom: 20px">未平衡数量</div>
|
||||
<el-table
|
||||
:data="tableData2"
|
||||
border
|
||||
style="max-height: 400px;margin-top:10px"
|
||||
height="320">
|
||||
<el-table-column label="零件图号" align="center" width="300">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件名称" align="center" width="200">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件数量" align="center" width="100">
|
||||
<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="操作" width="200px" fixed="right" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
@click="handleEdit(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent2"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize2"
|
||||
:total="total2"
|
||||
style="float:left"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange2"
|
||||
@current-change="handleCurrentChange2"/>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<div style="font-size: 20px;margin-bottom: 20px">未分配采购零件数量</div>
|
||||
<el-tabs type="border-card" @tab-click="searchTable1();searchTable2()">
|
||||
<el-tab-pane label="标准件和外购件">
|
||||
<el-table :data="tableData3" size="mini" style="max-height: 320px" height="320px" border>
|
||||
<el-table-column align="center" label="机床图号" min-width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="组号" min-width="80px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.组号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="物料类别" min-width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料类别 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="物料品种" min-width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料品种 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="图号或型号" min-width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料型号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="名称" min-width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="规格" min-width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料规格 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="数量" min-width="80px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="备注" min-width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.备注 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="200px" fixed="right" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
@click="type=2;handleEdit(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent3"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize3"
|
||||
:total="total3"
|
||||
style="display:inline-block;width:50%"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange3"
|
||||
@current-change="handleCurrentChange3"/>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="基本件">
|
||||
<el-table :data="tableData4" size="mini" style="max-height: 320px" height="320px" border>
|
||||
<el-table-column align="center" label="机床图号" min-width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="组号" min-width="80px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.组号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="图号" min-width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="名称" min-width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="规格" min-width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.规格 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="材料" min-width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.材料 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="数量" min-width="80px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="备注" min-width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.备注 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="200px" fixed="right" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
@click="type=2;handleEdit(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent4"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize4"
|
||||
:total="total4"
|
||||
style="display:inline-block;width:50%"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange4"
|
||||
@current-change="handleCurrentChange4"/>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
<el-dialog :visible.sync="dialogFormVisible3" title="更改数量" center style="min-height: 300px" width="400px">
|
||||
<el-form ref="form3" :model="form3" :rules="rules3" label-position="left" label-width="110px" class="demo-ruleForm">
|
||||
<el-form-item label="数量" prop="数量">
|
||||
<el-input
|
||||
v-model="form3.数量"
|
||||
size="small"
|
||||
style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitEdit('form3')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { projectSelect, machineSelect, groupSelect, basicPartsData, deleteBasicParts, purchasePartsData, deletePurchaseData, editPurchaseData, editBasicParts, getTable, editProductNum, getTable1, editProduceNum, searchTable1, searchTable2, editGroupBasicPartNum, editGroupPartNum } from '@/api/BasicData/PartsNumberMaintenance'
|
||||
export default {
|
||||
name: 'Index',
|
||||
data() {
|
||||
return {
|
||||
projectValue: '',
|
||||
BasicParts: '',
|
||||
PurchaseData: '',
|
||||
productNum: '',
|
||||
produceNum: '',
|
||||
partNumber: '',
|
||||
groupPartNum: '',
|
||||
groupBasicPartNum: '',
|
||||
type: '',
|
||||
project: [],
|
||||
machineValue: '',
|
||||
machine: [],
|
||||
groupValue: '',
|
||||
group: [],
|
||||
form3: {
|
||||
数量: ''
|
||||
},
|
||||
rules3: {
|
||||
数量: [{ required: true, message: '请输入数量', trigger: 'blur' }]
|
||||
},
|
||||
dialogFormVisible3: false,
|
||||
loading: false,
|
||||
loadingWB: false,
|
||||
total: 0,
|
||||
tableData: [],
|
||||
tableData1: [],
|
||||
tableData2: [],
|
||||
tableData3: [],
|
||||
tableDataWB: [],
|
||||
pageCurrent: 1,
|
||||
pageSize: 10,
|
||||
pageCurrent1: 1,
|
||||
pageSize1: 10,
|
||||
total1: 0,
|
||||
pageCurrent2: 1,
|
||||
pageSize2: 10,
|
||||
total2: 0,
|
||||
pageCurrent3: 1,
|
||||
pageSize3: 10,
|
||||
total3: 0,
|
||||
pageCurrent4: 1,
|
||||
pageSize4: 10,
|
||||
total4: 0,
|
||||
pageCurrentWB: 1,
|
||||
pageSizeWB: 10,
|
||||
totalWB: 0
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
groupName() {
|
||||
for (let i = 0; i < this.group.length; i++) {
|
||||
if (this.group[i].value === this.groupValue) {
|
||||
return this.group[i].label
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
project(val) {
|
||||
console.log(val)
|
||||
if (val.length > 0) {
|
||||
this.projectValue = val[0].value
|
||||
}
|
||||
},
|
||||
projectValue(val) {
|
||||
this.machineValue = ''
|
||||
this.machine = []
|
||||
this.groupValue = ''
|
||||
this.group = []
|
||||
if (val) {
|
||||
this.getMachineSelect(val)
|
||||
}
|
||||
},
|
||||
machine(val) {
|
||||
if (val.length > 0) {
|
||||
this.machineValue = val[0].value
|
||||
}
|
||||
},
|
||||
machineValue(val) {
|
||||
this.groupValue = ''
|
||||
this.group = []
|
||||
if (val) {
|
||||
this.getGroupSelect(val)
|
||||
}
|
||||
},
|
||||
group(val) {
|
||||
if (val.length > 0) {
|
||||
this.groupValue = val[0].value
|
||||
}
|
||||
},
|
||||
groupValue(val) {
|
||||
if (val) {
|
||||
this.pageCurrentWB = 1
|
||||
this.pageSizeWB = 10
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = 10
|
||||
this.getTableData()
|
||||
this.getTable()
|
||||
this.getTable1()
|
||||
this.searchTable1()
|
||||
this.searchTable2()
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
this.getSelect(projectSelect, ['项目名称', '项目流水号'], 'project')
|
||||
},
|
||||
getMachineSelect(val) {
|
||||
this.getSelect(machineSelect, ['机床图号', '机床流水号'], 'machine', val)
|
||||
},
|
||||
getGroupSelect(val) {
|
||||
this.getSelect(groupSelect, ['组号', '组件流水号'], 'group', val)
|
||||
},
|
||||
getTableData() {
|
||||
const project_check = this.projectValue ? 1 : 0
|
||||
const machine_check = this.machineValue ? 1 : 0
|
||||
const group_check = this.groupValue ? 1 : 0
|
||||
this.loading = true
|
||||
basicPartsData(project_check, this.projectValue, machine_check, this.machineValue, group_check, this.groupValue, this.pageSize, this.pageCurrent).then(response => {
|
||||
this.loading = false
|
||||
const res = response.data
|
||||
this.total = res.total
|
||||
console.log(this.tableData)
|
||||
this.tableData = res.rows.map(item => {
|
||||
if (item.整改类型 === '1') {
|
||||
item.整改类型 = '新增'
|
||||
} else if (item.整改类型 === '2') {
|
||||
item.整改类型 = '替换'
|
||||
} else if (item.整改类型 === '3') {
|
||||
item.整改类型 = '补充加工'
|
||||
}
|
||||
return item
|
||||
})
|
||||
})
|
||||
this.loadingWB = true
|
||||
purchasePartsData(this.groupValue, this.pageCurrentWB, this.pageSizeWB).then(response => {
|
||||
this.loadingWB = false
|
||||
const data = response.data
|
||||
this.totalWB = data.total
|
||||
this.tableDataWB = data.rows.map(item => {
|
||||
console.log(item)
|
||||
item.零件类型 = item.零件类型 === '2' ? '外购件' : '标准件'
|
||||
return item
|
||||
})
|
||||
})
|
||||
},
|
||||
getTable() {
|
||||
this.tableData1 = []
|
||||
getTable(this.groupValue, this.pageCurrent1, this.pageSize1).then(response => {
|
||||
this.total1 = parseInt(response.data.total)
|
||||
this.tableData1 = []
|
||||
for (let i = 0; i < response.data.rows.length; i++) {
|
||||
this.tableData1.push({
|
||||
零件图号: response.data.rows[i].零件图号,
|
||||
零件名称: response.data.rows[i].零件名称,
|
||||
投产总数量: response.data.rows[i].投产总数量,
|
||||
最大投产批次: response.data.rows[i].最大投产批次,
|
||||
已投产数量: response.data.rows[i].已投产数量,
|
||||
未投产数量: response.data.rows[i].未投产数量,
|
||||
零件类型名称: response.data.rows[i].零件类型名称,
|
||||
组件零件基本件流水号: response.data.rows[i].组件零件基本件流水号,
|
||||
投产类型流水号: response.data.rows[i].投产类型流水号,
|
||||
数据类型: response.data.rows[i].数据类型,
|
||||
材料流水号: response.data.rows[i].材料流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getTable1() {
|
||||
this.tableData2 = []
|
||||
this.checked_entryName = false
|
||||
if (this.machineValue === '') {
|
||||
this.checked_toolNum = false
|
||||
} else {
|
||||
this.checked_toolNum = true
|
||||
}
|
||||
if (this.groupValue === '') {
|
||||
this.checked_Num = false
|
||||
} else {
|
||||
this.checked_Num = true
|
||||
}
|
||||
if (this.partNumber !== '' && this.partNumber !== null) {
|
||||
this.checked_partNumber = true
|
||||
} else {
|
||||
this.checked_partNumber = false
|
||||
}
|
||||
getTable1(this.checked_entryName, '', this.checked_toolNum, this.machineValue, this.checked_Num, this.groupValue, this.checked_partNumber, this.partNumber, this.pageCurrent2, this.pageSize2).then(response => {
|
||||
for (let i = 0; i < response.data.rows.length; i++) {
|
||||
response.data.rows[i].机加工开始时间_长日期 = response.data.rows[i].机加工开始时间_长日期.substring(0, response.data.rows[i].机加工开始时间_长日期.indexOf(' '))
|
||||
response.data.rows[i].机加工结束时间_长日期 = response.data.rows[i].机加工结束时间_长日期.substring(0, response.data.rows[i].机加工结束时间_长日期.indexOf(' '))
|
||||
}
|
||||
this.total2 = parseInt(response.data.total)
|
||||
for (let i = 0; i < response.data.rows.length; i++) {
|
||||
this.tableData2.push({
|
||||
零件图号: response.data.rows[i].零件图号,
|
||||
零件名称: response.data.rows[i].零件名称,
|
||||
投产数量: response.data.rows[i].投产数量,
|
||||
机加工开始时间: response.data.rows[i].机加工开始时间_长日期,
|
||||
机加工结束时间: response.data.rows[i].机加工结束时间_长日期,
|
||||
工序数量: response.data.rows[i].工序数量,
|
||||
工艺计划流水号: response.data.rows[i].工艺计划流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
searchTable1() { // 查询标准件和外购件
|
||||
let check0, check1, check2
|
||||
this.projectValue ? check2 = 1 : check2 = 0
|
||||
this.machineValue ? check0 = 1 : check0 = 0
|
||||
this.groupValue ? check1 = 1 : check1 = 0
|
||||
searchTable1(this.pageCurrent3, this.pageSize3, check2, this.projectValue, check0, this.machineValue, check1, this.groupValue).then(response => {
|
||||
this.tableData3 = response.data.rows
|
||||
this.total3 = response.data.total
|
||||
})
|
||||
},
|
||||
searchTable2() { // 查询基本件
|
||||
let check0, check1, check2
|
||||
this.projectValue ? check2 = 1 : check2 = 0
|
||||
this.machineValue ? check0 = 1 : check0 = 0
|
||||
this.groupValue ? check1 = 1 : check1 = 0
|
||||
searchTable2(this.pageCurrent4, this.pageSize4, check2, this.projectValue, check0, this.machineValue, check1, this.groupValue).then(response => {
|
||||
this.tableData4 = response.data.rows
|
||||
this.total4 = response.data.total
|
||||
})
|
||||
},
|
||||
handleEdit(row) {
|
||||
this.BasicParts = ''
|
||||
this.PurchaseData = ''
|
||||
this.productNum = ''
|
||||
this.produceNum = ''
|
||||
if (this.$refs['form3'] !== undefined) {
|
||||
this.$refs['form3'].resetFields()
|
||||
}
|
||||
this.dialogFormVisible3 = true
|
||||
if (row.基本件流水号 && this.type === 1) {
|
||||
this.BasicParts = row.基本件流水号
|
||||
this.form3.数量 = row.零件数量
|
||||
} else if (row.标准件和外购件流水号 && this.type === 1) {
|
||||
this.PurchaseData = row.标准件和外购件流水号
|
||||
this.form3.数量 = row.零件数量
|
||||
} else if (row.组件零件基本件流水号 && this.type === 1) {
|
||||
this.productNum = row.组件零件基本件流水号
|
||||
this.form3.数量 = row.投产总数量
|
||||
} else if (row.工艺计划流水号) {
|
||||
this.produceNum = row.工艺计划流水号
|
||||
this.form3.数量 = row.投产数量
|
||||
} else if (row.组件零件流水号 && this.type === 2) {
|
||||
this.groupPartNum = row.组件零件流水号
|
||||
this.form3.数量 = row.零件数量
|
||||
} else if (row.组件零件基本件流水号 && this.type === 2) {
|
||||
this.groupBasicPartNum = row.组件零件基本件流水号
|
||||
this.form3.数量 = row.数量
|
||||
}
|
||||
},
|
||||
submitEdit(formName) { // 提交单据编辑
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.BasicParts !== '') {
|
||||
editBasicParts(this.BasicParts, this.form3.数量).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('编辑成功')
|
||||
this.dialogFormVisible3 = false
|
||||
this.getTableData()
|
||||
} else { this.$message.error('编辑失败') }
|
||||
})
|
||||
} else if (this.PurchaseData !== '') {
|
||||
editPurchaseData(this.PurchaseData, this.form3.数量).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('编辑成功')
|
||||
this.dialogFormVisible3 = false
|
||||
this.getTableData()
|
||||
} else { this.$message.error('编辑失败') }
|
||||
})
|
||||
} else if (this.productNum !== '') {
|
||||
editProductNum(this.productNum, this.form3.数量).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('编辑成功')
|
||||
this.dialogFormVisible3 = false
|
||||
this.getTable()
|
||||
} else { this.$message.error('编辑失败') }
|
||||
})
|
||||
} else if (this.produceNum !== '') {
|
||||
editProduceNum(this.produceNum, this.form3.数量).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('编辑成功')
|
||||
this.dialogFormVisible3 = false
|
||||
this.getTable1()
|
||||
} else { this.$message.error('编辑失败') }
|
||||
})
|
||||
} else if (this.groupPartNum !== '') {
|
||||
editGroupPartNum(this.groupPartNum, this.form3.数量).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('编辑成功')
|
||||
this.dialogFormVisible3 = false
|
||||
this.searchTable1()
|
||||
} else { this.$message.error('编辑失败') }
|
||||
})
|
||||
} else if (this.groupBasicPartNum !== '') {
|
||||
editGroupBasicPartNum(this.groupBasicPartNum, this.form3.数量).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('编辑成功')
|
||||
this.dialogFormVisible3 = false
|
||||
this.searchTable2()
|
||||
} else { this.$message.error('编辑失败') }
|
||||
})
|
||||
}
|
||||
} else {
|
||||
console.log('error submit!!')
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
handleDelete(row) {
|
||||
if (row.基本件流水号) {
|
||||
this.deleteRow(deleteBasicParts, row.基本件流水号, function() {
|
||||
this.getTableData()
|
||||
})
|
||||
} else {
|
||||
this.deleteRow(deletePurchaseData, row.标准件和外购件流水号, function() {
|
||||
this.getTableData()
|
||||
})
|
||||
}
|
||||
},
|
||||
handleSizeChanges(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.getTableData()
|
||||
},
|
||||
handleCurrentChanges(val) {
|
||||
this.pageCurrent = val
|
||||
this.getTableData()
|
||||
},
|
||||
handleSizeChangeWB(val) {
|
||||
this.pageCurrentWB = 1
|
||||
this.pageSizeWB = val
|
||||
this.getTableData()
|
||||
},
|
||||
handleCurrentChangeWB(val) {
|
||||
this.pageCurrentWB = val
|
||||
this.getTableData()
|
||||
},
|
||||
handleSizeChange1(val) {
|
||||
this.pageCurrent1 = 1
|
||||
this.pageSize1 = val
|
||||
this.getTable()
|
||||
},
|
||||
handleCurrentChange1(val) {
|
||||
this.pageCurrent1 = val
|
||||
this.getTable()
|
||||
},
|
||||
handleSizeChange2(val) {
|
||||
this.pageSize2 = val
|
||||
this.pageCurrent2 = 1
|
||||
this.getTable1()
|
||||
},
|
||||
handleCurrentChange2(val) {
|
||||
this.pageCurrent2 = val
|
||||
this.getTable1()
|
||||
},
|
||||
handleSizeChange3(val) {
|
||||
this.pageSize3 = val
|
||||
this.pageCurrent3 = 1
|
||||
this.searchTable1()
|
||||
},
|
||||
handleCurrentChange3(val) {
|
||||
this.pageCurrent3 = val
|
||||
this.searchTable1()
|
||||
},
|
||||
handleSizeChange4(val) {
|
||||
this.pageSize4 = val
|
||||
this.pageCurrent4 = 1
|
||||
this.searchTable2()
|
||||
},
|
||||
handleCurrentChange4(val) {
|
||||
this.pageCurrent4 = val
|
||||
this.searchTable2()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
span{
|
||||
margin: 20px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user