|
@@ -182,6 +182,7 @@ export default {
|
|
|
expands: [], // 展开行的key
|
|
|
qiyongStatus: [], //状态
|
|
|
statusList: [], // 启用状态
|
|
|
+ workpieceId: [],
|
|
|
queryParams: initQueryParams({}),
|
|
|
selection: [],
|
|
|
loading: false,
|
|
@@ -316,7 +317,8 @@ export default {
|
|
|
setTenant (val) {
|
|
|
if(val){
|
|
|
this.tenant = { ...val }
|
|
|
- }
|
|
|
+ }
|
|
|
+ this.getWorkpiece()
|
|
|
this.fetch()
|
|
|
},
|
|
|
close () {
|
|
@@ -407,6 +409,18 @@ export default {
|
|
|
this.addViewTitle = "选择抽检工序"
|
|
|
this.addViewVisible = true
|
|
|
},
|
|
|
+ //获取工件ID
|
|
|
+ async getWorkpiece(){
|
|
|
+ let params = {current:1, size:1000, model:{planId: this.tenant.id}}
|
|
|
+ await inspectionApi.getWorkpiece(params).then(response => {
|
|
|
+ const res = response.data
|
|
|
+ if (res.isSuccess) {
|
|
|
+ res.data.records.forEach(item =>{
|
|
|
+ this.workpieceId.push(item.id);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
// 获取列表数据-函数
|
|
|
fetch (params = {}) {
|
|
|
this.loading = true
|
|
@@ -416,7 +430,7 @@ export default {
|
|
|
this.queryParams.size = params.size ? params.size : this.queryParams.size
|
|
|
// 必须传的参数
|
|
|
this.queryParams.model.planId = this.tenant.id
|
|
|
-
|
|
|
+
|
|
|
// 测试数据,真实数据,请使用page
|
|
|
inspectionApi.page(this.queryParams).then(response => {
|
|
|
const res = response.data
|
|
@@ -425,11 +439,11 @@ export default {
|
|
|
this.tableData.total = this.tenant.planBomNum;
|
|
|
//console.log(this.tenant)
|
|
|
this.tableData.records = []
|
|
|
- let workpieceIdArr = this.tenant.workpieceIds.split(',')
|
|
|
+ //let workpieceIdArr = this.tenant.workpieceIds.split(',')
|
|
|
//只显示未加工完成的零件
|
|
|
for(let i=Number(this.tenant.completeNum); 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
|
|
|
+ startTime:this.tenant.startTime, endTime:this.tenant.endTime, id:this.workpieceId[i], hasChildren:false
|
|
|
}
|
|
|
if(res.data.records.length > 0){
|
|
|
plan.children = []
|