Browse Source

人工叫料执行特殊操作处理

dev_web_online
安虹睿 2 years ago
parent
commit
16f3012301
  1. 119
      fe/PC/src/views/rawMaterialManage/manualMaterialRequest/IssueRequest.vue

119
fe/PC/src/views/rawMaterialManage/manualMaterialRequest/IssueRequest.vue

@ -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>

Loading…
Cancel
Save