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> </div>
</template> </template>
<script> <script>
import { materialRequestByType,processRequest } from "@/api/wms-api" import { materialRequestByType,processRequest,getDetailed } from "@/api/wms-api"
import { tableMixins } from "@/mixins/TableMixins" import { tableMixins } from "@/mixins/TableMixins"
import { LoadingMixins } from "@/mixins/LoadingMixins" import { LoadingMixins } from "@/mixins/LoadingMixins"
import { drawerMixins } from "@/mixins/drawerMixins" import { drawerMixins } from "@/mixins/drawerMixins"
@ -96,8 +96,10 @@ export default {
this.defaultFreshBtn(),// this.defaultFreshBtn(),//
this.defaultFilterBtn(),// this.defaultFilterBtn(),//
], ],
//
oldIssueJobIds: [],
DrawerButtonData: [ DrawerButtonData: [
...requestData(this), // ...requestData(this),
{ {
type: 'primary', type: 'primary',
icon: 'el-icon-circle-check', icon: 'el-icon-circle-check',
@ -106,35 +108,15 @@ export default {
name: "completeRequest", name: "completeRequest",
size: 'mini' size: 'mini'
}, },
// { {
// type: 'primary', type: 'primary',
// icon: 'el-icon-circle-check', icon: 'el-icon-circle-check',
// label: '', label: '执行',
// name: "IssueRequest-zx", name: "IssueRequest-zx",
// hide: () => { return this.againHandleRequestInit([9])}, hide: () => { return this.againHandleRequestInit([9])},
// size: 'mini' size: 'mini'
// }, },
// ...requestData(this,false, ...requestData(this,false,false,['againHandleRequest']),
// 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'
// },
], ],
}; };
}, },
@ -168,7 +150,7 @@ export default {
}) })
return data return data
}, },
// ==9 // ==9
againHandleRequestInit(val){ againHandleRequestInit(val){
let data = true let data = true
val.forEach(key => { val.forEach(key => {
@ -178,26 +160,61 @@ export default {
}) })
return data return data
}, },
//
handleResult(){
getDetailed(this.propsData.id, this.URL).then(res => {
this.propsData = res
})
this.paging()
this.Loading.appMainLoading = false
},
// //
// drawerbutton (val) { drawerbutton (val) {
// // todo: // todo:
// if(val == 'IssueRequest-zx'){ if(val == 'IssueRequest-zx'){
// this.Loading.appMainLoading = true this.Loading.appMainLoading = true
// processRequest(this.propsData.id, this.URL + '/handle/').then(res => { //
// this.$successMsg('') processRequest(this.propsData.number,'wms/store/issue-job/by-request-number/').then(resFirst=>{
// getDetailed(this.propsData.id, this.URL).then(res => { this.oldIssueJobIds = []
// this.propsData = res resFirst.forEach(item=>{
// }) this.oldIssueJobIds.push(item.id)
// this.paging() })
// this.Loading.appMainLoading = false //
// }).catch(err => { processRequest(this.propsData.id, this.URL + '/handle/').then(resHandle => {
// console.log(err) //
// this.Loading.appMainLoading = false processRequest(this.propsData.number,'wms/store/issue-job/by-request-number/').then(resNew=>{
// }) //
// } else { if(!resNew || resNew.length <= 0){
// drawerMixins.methods.drawerbutton(val, this) 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> </script>

Loading…
Cancel
Save