|
|
@@ -9,34 +9,13 @@
|
|
|
top="50px"
|
|
|
>
|
|
|
<el-form ref="form" :model="tenant" :rules="rules" label-position="right" label-width="130px">
|
|
|
- <div class="filter-container">
|
|
|
- <!--<span>
|
|
|
- <span>{{$t("prepare.searchForm.productName")}}:</span>
|
|
|
- <el-input v-model="queryParams.model.name" :placeholder='$t("common.pleaseEnter")' style="width: 150px;" size="medium"/>
|
|
|
- </span>
|
|
|
- <span style="margin-left: 15px;">
|
|
|
- <span>{{$t("prepare.searchForm.model")}}:</span>
|
|
|
- <el-input v-model="queryParams.model.model" :placeholder='$t("common.pleaseEnter")' style="width: 150px;" size="medium"/>
|
|
|
- </span>
|
|
|
- <span style="margin-left: 15px;">
|
|
|
- <el-button plain type="primary" icon="el-icon-search" size="medium" @click="search">
|
|
|
- {{ $t("table.search") }}
|
|
|
- </el-button>
|
|
|
- <el-button plain type="warning" icon="el-icon-refresh" size="medium" @click="reset">
|
|
|
- {{ $t("table.reset") }}
|
|
|
- </el-button>
|
|
|
- </span>-->
|
|
|
+ <div class="filter-container">
|
|
|
<!-- 增加抽检 -->
|
|
|
- <el-button type="primary" icon="el-icon-plus" size="medium" @click="addChoujian()">
|
|
|
+ <el-button type="primary" icon="el-icon-plus" size="medium" @click="addInspection()">
|
|
|
{{ $t("runCenter.common.addBtn") }}
|
|
|
</el-button>
|
|
|
</div>
|
|
|
|
|
|
- <!-- 列表数据
|
|
|
- :expand-row-keys="expands"
|
|
|
- :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
|
|
- row-key="id"
|
|
|
- -->
|
|
|
<el-table
|
|
|
:key="tableKey"
|
|
|
ref="table"
|
|
|
@@ -45,7 +24,8 @@
|
|
|
border
|
|
|
fit
|
|
|
highlight-current-row
|
|
|
- style="width: 100%;"
|
|
|
+ style="width: 100%;"
|
|
|
+ row-key="id"
|
|
|
@selection-change="onSelectChange"
|
|
|
@cell-click="cellClick"
|
|
|
>
|
|
|
@@ -59,19 +39,39 @@
|
|
|
>
|
|
|
<!-- 工序号 -->
|
|
|
<el-table-column
|
|
|
- prop="id"
|
|
|
- :label="$t("runCenter.table.orderSldPro.partsNo")"
|
|
|
+ prop="procedureNo"
|
|
|
+ label="工序号"
|
|
|
align="center"
|
|
|
:show-overflow-tooltip="true"
|
|
|
>
|
|
|
<template slot-scope="{ row }">
|
|
|
- <span>{{ row.id }}</span>
|
|
|
+ <span>{{ row.procedureNo }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<!-- 工序名称 -->
|
|
|
<el-table-column
|
|
|
- prop="name"
|
|
|
- :label="$t("runCenter.table.orderSldPro.bomAlias")"
|
|
|
+ prop="procedureName"
|
|
|
+ label="工序名称"
|
|
|
+ align="center"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ />
|
|
|
+ <!-- 质检结果 -->
|
|
|
+ <el-table-column
|
|
|
+ prop="result"
|
|
|
+ label="质检结果"
|
|
|
+ align="center"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ >
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <span v-if="row.result==0">待定</span>
|
|
|
+ <span v-if="row.result==1">合格</span>
|
|
|
+ <span v-if="row.result==2">不合格</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- 质检报告 -->
|
|
|
+ <el-table-column
|
|
|
+ prop="report"
|
|
|
+ label="质检报告"
|
|
|
align="center"
|
|
|
:show-overflow-tooltip="true"
|
|
|
/>
|
|
|
@@ -80,54 +80,51 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="center" type="selection" width="40px" :reserve-selection="true" />
|
|
|
- <!-- 零件唯一码 -->
|
|
|
- <el-table-column
|
|
|
+ <el-table-column
|
|
|
prop="id"
|
|
|
+ :label="$t("runCenter.table.orderSldPro.id")"
|
|
|
+ align="center"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ width="160px"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <!-- 零件唯一码 -->
|
|
|
+ <el-table-column
|
|
|
+ prop="partsNo"
|
|
|
:label="$t("runCenter.table.orderSldPro.partsNo")"
|
|
|
align="center"
|
|
|
:show-overflow-tooltip="true"
|
|
|
- width="150px"
|
|
|
+ width="120px"
|
|
|
>
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <span>{{ row.id }}</span>
|
|
|
- </template>
|
|
|
</el-table-column>
|
|
|
<!-- 零件名称 -->
|
|
|
<el-table-column
|
|
|
- prop="name"
|
|
|
+ prop="bomName"
|
|
|
:label="$t("runCenter.table.orderSldPro.name")"
|
|
|
align="center"
|
|
|
/>
|
|
|
<!-- 零部件编号 -->
|
|
|
<el-table-column
|
|
|
- prop="address"
|
|
|
+ prop="partsAlias"
|
|
|
:label="$t("runCenter.table.orderSldPro.partsAlias")"
|
|
|
align="center"
|
|
|
- width="150px"
|
|
|
- />
|
|
|
- <!-- 数量 -->
|
|
|
- <el-table-column
|
|
|
- prop="name"
|
|
|
- :label="$t("runCenter.table.orderSldPro.bomAlias")"
|
|
|
- align="center"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
width="120px"
|
|
|
- />
|
|
|
+ />
|
|
|
<!-- 计划开始日期 -->
|
|
|
<el-table-column
|
|
|
- prop="date"
|
|
|
- :label="$t("runCenter.table.orderSldPro.bomAlias")"
|
|
|
+ prop="startTime"
|
|
|
+ label="计划开始时间"
|
|
|
align="center"
|
|
|
:show-overflow-tooltip="true"
|
|
|
- width="120px"
|
|
|
+ width="150px"
|
|
|
/>
|
|
|
<!-- 计划完成日期 -->
|
|
|
<el-table-column
|
|
|
- prop="date"
|
|
|
- :label="$t("runCenter.table.orderSldPro.bomAlias")"
|
|
|
+ prop="endTime"
|
|
|
+ label="计划完成时间"
|
|
|
align="center"
|
|
|
:show-overflow-tooltip="true"
|
|
|
- width="120px"
|
|
|
+ width="150px"
|
|
|
/>
|
|
|
|
|
|
</el-table>
|
|
|
@@ -141,6 +138,14 @@
|
|
|
@pagination="fetch"
|
|
|
/>
|
|
|
|
|
|
+ <!-- [抽检结果]的组件 -->
|
|
|
+ <add-inspection
|
|
|
+ ref="addView"
|
|
|
+ :dialog-visible="addViewVisible"
|
|
|
+ :title="addViewTitle"
|
|
|
+ @close="addViewClose"
|
|
|
+ />
|
|
|
+
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button plain type="warning" @click="isVisible = false">{{ $t('common.cancel') }}</el-button>
|
|
|
@@ -149,17 +154,19 @@
|
|
|
</el-dialog>
|
|
|
</template>
|
|
|
<script>
|
|
|
+// 【抽检管理】-API
|
|
|
+import inspectionApi from "@/api/runManageCenter/inspection"
|
|
|
// 【夹具管理】-API
|
|
|
import trayMgrApi from "@/api/prepareProductMgr/trayMgr"
|
|
|
+// 【新增抽检】组件
|
|
|
+import AddInspection from "./AddInspection"
|
|
|
// 【分页】组件
|
|
|
import Pagination from "@/components/Pagination"
|
|
|
-// 【BOM管理】-API
|
|
|
-import bomMgrApi from "@/api/prepareProductMgr/bomMgr"
|
|
|
// 【共通】函数
|
|
|
import { initQueryParams } from '@/utils/commons'
|
|
|
export default {
|
|
|
name: 'MyDraw',
|
|
|
- components: { Pagination },
|
|
|
+ components: { Pagination, AddInspection },
|
|
|
props: {
|
|
|
dialogVisible: {
|
|
|
type: Boolean,
|
|
|
@@ -183,6 +190,8 @@ export default {
|
|
|
tableData: {
|
|
|
total: 0
|
|
|
},
|
|
|
+ addViewVisible: false,
|
|
|
+ addViewTitle: '',
|
|
|
tenant: this.initTenant(),
|
|
|
screenWidth: 0,
|
|
|
width: this.initWidth(),
|
|
|
@@ -196,9 +205,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
|
|
|
- created() {
|
|
|
- // 加载列表数据
|
|
|
- this.fetch()
|
|
|
+ created() {
|
|
|
// 调用常量-初始化值
|
|
|
this.qiyongStatus = this.$constWKS.AUDIOLIST;
|
|
|
this.statusList = this.$constWKS.STATUSORTHERLIST;
|
|
|
@@ -293,15 +300,7 @@ export default {
|
|
|
},
|
|
|
initTenant () {
|
|
|
return {
|
|
|
- model: '',
|
|
|
- name: '',
|
|
|
- category: {
|
|
|
- key: ''
|
|
|
- },
|
|
|
- brand: {
|
|
|
- key: ''
|
|
|
- },
|
|
|
- status: '1'
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
initWidth () {
|
|
|
@@ -318,11 +317,14 @@ export default {
|
|
|
if(val){
|
|
|
this.tenant = { ...val }
|
|
|
}
|
|
|
+ this.fetch()
|
|
|
},
|
|
|
close () {
|
|
|
this.$emit('close')
|
|
|
},
|
|
|
-
|
|
|
+ addViewClose() {
|
|
|
+ this.addViewVisible = false;
|
|
|
+ },
|
|
|
// 【重置】按钮-事件
|
|
|
reset () {
|
|
|
// 初始化表单
|
|
|
@@ -385,10 +387,26 @@ export default {
|
|
|
},
|
|
|
|
|
|
// 新增抽检-按钮事件
|
|
|
- addChoujian() {
|
|
|
- console.log("新增抽检-按钮事件:");
|
|
|
- },
|
|
|
-
|
|
|
+ addInspection() {
|
|
|
+ if (!this.selection.length) {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t("tips.noDataSelected"),
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.selection.length > 1) {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t("tips.mustOne"),
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.tenant.workpieceId = this.selection[0].id
|
|
|
+ this.$refs.addView.setTenant(this.tenant)
|
|
|
+ this.addViewTitle = "选择抽检工序"
|
|
|
+ this.addViewVisible = true
|
|
|
+ },
|
|
|
// 获取列表数据-函数
|
|
|
fetch (params = {}) {
|
|
|
this.loading = true
|
|
|
@@ -397,47 +415,36 @@ export default {
|
|
|
this.queryParams.current = params.current ? params.current : this.queryParams.current
|
|
|
this.queryParams.size = params.size ? params.size : this.queryParams.size
|
|
|
// 必须传的参数
|
|
|
- this.queryParams.audit_status = '2'
|
|
|
+ this.queryParams.model.planId = this.tenant.id
|
|
|
+
|
|
|
// 测试数据,真实数据,请使用page
|
|
|
- bomMgrApi.page(this.queryParams).then(response => {
|
|
|
- const res = response.data
|
|
|
- console.log("列表的数据111122233:", res)
|
|
|
+ inspectionApi.page(this.queryParams).then(response => {
|
|
|
+ const res = response.data
|
|
|
if (res.isSuccess) {
|
|
|
// 总数
|
|
|
- this.tableData.total = 4;
|
|
|
- // 数据
|
|
|
- this.tableData.records = [{
|
|
|
- id: 1,
|
|
|
- date: '2016-05-02',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1518 弄'
|
|
|
- }, {
|
|
|
- id: 2,
|
|
|
- date: '2016-05-04',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1517 弄'
|
|
|
- }, {
|
|
|
- id: 3,
|
|
|
- date: '2016-05-01',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1519 弄',
|
|
|
- children: [{
|
|
|
- id: 31,
|
|
|
- date: '2016-05-01',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1519 弄'
|
|
|
- }, {
|
|
|
- id: 32,
|
|
|
- date: '2016-05-01',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1519 弄'
|
|
|
- }]
|
|
|
- }, {
|
|
|
- id: 4,
|
|
|
- date: '2016-05-03',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1516 弄'
|
|
|
- }];
|
|
|
+ this.tableData.total = this.tenant.planBomNum;
|
|
|
+ //console.log(this.tenant)
|
|
|
+ this.tableData.records = []
|
|
|
+ let workpieceIdArr = this.tenant.workpieceIds.split(',')
|
|
|
+ for(let i=0; i<this.tableData.total; i++){
|
|
|
+ let plan = {bomName:this.tenant.bomDesc, partsNo:this.tenant.partsNo,partsAlias:this.tenant.partsAlias,
|
|
|
+ startTime:this.tenant.startTime, endTime:this.tenant.endTime, id:workpieceIdArr[i], hasChildren:false
|
|
|
+ }
|
|
|
+ if(res.data.records.length > 0){
|
|
|
+ plan.children = []
|
|
|
+ res.data.records.forEach(item =>{
|
|
|
+ if(plan.id == item.workpieceId){
|
|
|
+ let workpiece = {procedureNo:item.procedureNo, procedureName:item.procedureName,
|
|
|
+ result: item.result, report:item.report
|
|
|
+ }
|
|
|
+ plan.children.push(workpiece)
|
|
|
+ plan.hasChildren = true
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.tableData.records.push(plan)
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
// eslint-disable-next-line no-return-assign
|
|
|
}).finally(() => this.loading = false)
|