|
|
@ -60,7 +60,7 @@ |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import { materialRequestByType,processRequest } from "@/api/wms-api" |
|
|
|
import { materialRequestByType,processRequest,getDetailed } from "@/api/wms-api" |
|
|
|
import { tableMixins } from "@/mixins/TableMixins" |
|
|
|
import { LoadingMixins } from "@/mixins/LoadingMixins" |
|
|
|
import { drawerMixins } from "@/mixins/drawerMixins" |
|
|
@ -96,8 +96,10 @@ export default { |
|
|
|
this.defaultFreshBtn(),//刷新 |
|
|
|
this.defaultFilterBtn(),//筛选 |
|
|
|
], |
|
|
|
//执行前获取记录数据暂存 |
|
|
|
oldIssueJobIds: [], |
|
|
|
DrawerButtonData: [ |
|
|
|
...requestData(this), |
|
|
|
// ...requestData(this), |
|
|
|
{ |
|
|
|
type: 'primary', |
|
|
|
icon: 'el-icon-circle-check', |
|
|
@ -106,35 +108,15 @@ export default { |
|
|
|
name: "completeRequest", |
|
|
|
size: 'mini' |
|
|
|
}, |
|
|
|
// { |
|
|
|
// type: 'primary', |
|
|
|
// icon: 'el-icon-circle-check', |
|
|
|
// label: '执行', |
|
|
|
// name: "IssueRequest-zx", |
|
|
|
// hide: () => { return this.againHandleRequestInit([9])}, |
|
|
|
// size: 'mini' |
|
|
|
// }, |
|
|
|
// ...requestData(this,false, |
|
|
|
// false, |
|
|
|
// { |
|
|
|
// againHandleRequest:() => {return this.againHandleRequestInit([9])}, |
|
|
|
// // abortRequest:() => {return this.abortRequestRequestInit([2,6])}, |
|
|
|
// }, |
|
|
|
// ['againHandleRequest'] |
|
|
|
// ), |
|
|
|
//使用 initHide 函数处理是否隐藏 |
|
|
|
// ...requestData(this,false,{ |
|
|
|
// againHandleRequest:() => {return this.againHandleRequestInit([9])} |
|
|
|
// }), |
|
|
|
//使用 noShow 隐藏按钮 |
|
|
|
// ...requestData(this,false,false,['againHandleRequest']), |
|
|
|
// { |
|
|
|
// type: 'primary', |
|
|
|
// icon: 'el-icon-circle-check', |
|
|
|
// label: '完成', |
|
|
|
// name: "completeRequest", |
|
|
|
// size: 'mini' |
|
|
|
// }, |
|
|
|
{ |
|
|
|
type: 'primary', |
|
|
|
icon: 'el-icon-circle-check', |
|
|
|
label: '执行', |
|
|
|
name: "IssueRequest-zx", |
|
|
|
hide: () => { return this.againHandleRequestInit([9])}, |
|
|
|
size: 'mini' |
|
|
|
}, |
|
|
|
...requestData(this,false,false,['againHandleRequest']), |
|
|
|
], |
|
|
|
}; |
|
|
|
}, |
|
|
@ -168,7 +150,7 @@ export default { |
|
|
|
}) |
|
|
|
return data |
|
|
|
}, |
|
|
|
// 重新定义【执行按钮】显示判断 ==9时候显示 |
|
|
|
// 定义【执行按钮】显示判断 ==9时候显示 |
|
|
|
againHandleRequestInit(val){ |
|
|
|
let data = true |
|
|
|
val.forEach(key => { |
|
|
@ -178,26 +160,61 @@ export default { |
|
|
|
}) |
|
|
|
return data |
|
|
|
}, |
|
|
|
// 执行成功后处理 |
|
|
|
handleResult(){ |
|
|
|
getDetailed(this.propsData.id, this.URL).then(res => { |
|
|
|
this.propsData = res |
|
|
|
}) |
|
|
|
this.paging() |
|
|
|
this.Loading.appMainLoading = false |
|
|
|
}, |
|
|
|
//抽屉常用按钮 |
|
|
|
// drawerbutton (val) { |
|
|
|
// // 执行(todo:后期本页特殊) |
|
|
|
// if(val == 'IssueRequest-zx'){ |
|
|
|
// this.Loading.appMainLoading = true |
|
|
|
// processRequest(this.propsData.id, this.URL + '/handle/').then(res => { |
|
|
|
// this.$successMsg('处理完成') |
|
|
|
// getDetailed(this.propsData.id, this.URL).then(res => { |
|
|
|
// this.propsData = res |
|
|
|
// }) |
|
|
|
// this.paging() |
|
|
|
// this.Loading.appMainLoading = false |
|
|
|
// }).catch(err => { |
|
|
|
// console.log(err) |
|
|
|
// this.Loading.appMainLoading = false |
|
|
|
// }) |
|
|
|
// } else { |
|
|
|
// drawerMixins.methods.drawerbutton(val, this) |
|
|
|
// } |
|
|
|
// }, |
|
|
|
drawerbutton (val) { |
|
|
|
// 执行(todo:后期本页特殊) |
|
|
|
if(val == 'IssueRequest-zx'){ |
|
|
|
this.Loading.appMainLoading = true |
|
|
|
// 获取记录数据暂存 |
|
|
|
processRequest(this.propsData.number,'wms/store/issue-job/by-request-number/').then(resFirst=>{ |
|
|
|
this.oldIssueJobIds = [] |
|
|
|
resFirst.forEach(item=>{ |
|
|
|
this.oldIssueJobIds.push(item.id) |
|
|
|
}) |
|
|
|
// 执行操作 |
|
|
|
processRequest(this.propsData.id, this.URL + '/handle/').then(resHandle => { |
|
|
|
// 重新获取记录对比 |
|
|
|
processRequest(this.propsData.number,'wms/store/issue-job/by-request-number/').then(resNew=>{ |
|
|
|
// 重新获取的记录为空(未生成任务) |
|
|
|
if(!resNew || resNew.length <= 0){ |
|
|
|
this.$errorMsg('没有可用库存,未生成新任务') |
|
|
|
this.handleResult() |
|
|
|
return |
|
|
|
} |
|
|
|
// 当前有记录 |
|
|
|
if(resNew && resNew.length > 0){ |
|
|
|
let _newIds = [] |
|
|
|
resNew.forEach(item=>{ |
|
|
|
_newIds.push(item.id) |
|
|
|
}) |
|
|
|
if(this.oldIssueJobIds.sort().toString() === _newIds.sort().toString()){ |
|
|
|
this.$errorMsg('没有可用库存,未生成新任务') |
|
|
|
}else{ |
|
|
|
this.$successMsg('执行成功,已生成新任务') |
|
|
|
} |
|
|
|
this.handleResult() |
|
|
|
} |
|
|
|
}) |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
this.Loading.appMainLoading = false |
|
|
|
}) |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
this.Loading.appMainLoading = false |
|
|
|
}) |
|
|
|
} else { |
|
|
|
drawerMixins.methods.drawerbutton(val, this) |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
}; |
|
|
|
</script> |
|
|
|