|
@ -275,11 +275,9 @@ |
|
|
console.log(JSON.stringify(params)) |
|
|
console.log(JSON.stringify(params)) |
|
|
|
|
|
|
|
|
let list = [] |
|
|
let list = [] |
|
|
try { |
|
|
|
|
|
var planData = await planReceiptSubmit(params) |
|
|
var planData = await planReceiptSubmit(params) |
|
|
console.log('planData', planData) |
|
|
console.log('planData', planData) |
|
|
if (planData.data) { |
|
|
if (planData.data && planData.data.length > 0) { |
|
|
|
|
|
|
|
|
planData.data.forEach(item => { |
|
|
planData.data.forEach(item => { |
|
|
list.push({ |
|
|
list.push({ |
|
|
itemCode: item.itemCode, // 物品代码 |
|
|
itemCode: item.itemCode, // 物品代码 |
|
@ -302,17 +300,6 @@ |
|
|
} else { |
|
|
} else { |
|
|
throw new Error("提交失败") |
|
|
throw new Error("提交失败") |
|
|
} |
|
|
} |
|
|
} catch (error) { |
|
|
|
|
|
console.log('异常', error) |
|
|
|
|
|
if (error.indexOf('请返回开工阶段') > -1) { |
|
|
|
|
|
uni.hideLoading() |
|
|
|
|
|
this.showErrorMessage('计划已完成') |
|
|
|
|
|
this.clearData() |
|
|
|
|
|
this.openFg(); |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//装配收货记录 生成后 创建 制品上架申请 |
|
|
//装配收货记录 生成后 创建 制品上架申请 |
|
|
let createProductputawaySwitch = getSwitchInfoByCode( |
|
|
let createProductputawaySwitch = getSwitchInfoByCode( |
|
@ -324,14 +311,16 @@ |
|
|
// } |
|
|
// } |
|
|
//创建上架申请和检验申请 |
|
|
//创建上架申请和检验申请 |
|
|
if (createProductputawaySwitch) { |
|
|
if (createProductputawaySwitch) { |
|
|
|
|
|
if (list.length > 0 && list[0].requestNumber) { |
|
|
createPutawayRequestByPlan(list[0].requestNumber).then(res => { |
|
|
createPutawayRequestByPlan(list[0].requestNumber).then(res => { |
|
|
createInspectRequestByPlan(list[0].requestNumber) |
|
|
createInspectRequestByPlan(list[0].requestNumber) |
|
|
}) |
|
|
}) |
|
|
|
|
|
} |
|
|
} else { //创建检验申请 |
|
|
} else { //创建检验申请 |
|
|
|
|
|
if (list.length > 0 && list[0].requestNumber) { |
|
|
createInspectRequestByPlan(list[0].requestNumber) |
|
|
createInspectRequestByPlan(list[0].requestNumber) |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var queryParams = { |
|
|
var queryParams = { |
|
|
filters: [{ |
|
|
filters: [{ |
|
@ -375,16 +364,25 @@ |
|
|
this.index = 1; |
|
|
this.index = 1; |
|
|
this.dataContent.handleQty = 0; |
|
|
this.dataContent.handleQty = 0; |
|
|
} |
|
|
} |
|
|
|
|
|
var hintMsg ="提交成功\n生成装配收货记录\n"; |
|
|
|
|
|
if(list.length>0&&list[0].requestNumber){ |
|
|
|
|
|
hintMsg += list[0].requestNumber |
|
|
|
|
|
} |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
|
this.showCommitSuccessMessage("提交成功\n生成装配收货记录\n" + list[0].requestNumber, list) |
|
|
this.showCommitSuccessMessage(hintMsg, list) |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
uni.hideLoading() |
|
|
uni.hideLoading() |
|
|
var hint = error.message ? error.message : error |
|
|
var hint = error.message ? error.message : error |
|
|
|
|
|
if (hint.indexOf('请返回开工阶段') > -1) { |
|
|
|
|
|
this.showErrorMessage('计划已完成') |
|
|
|
|
|
this.clearData() |
|
|
|
|
|
this.openFg(); |
|
|
|
|
|
} else { |
|
|
this.showErrorMessage(hint) |
|
|
this.showErrorMessage(hint) |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|