Browse Source

修改装配报工和收货库位提示

hella_online_20240803
lijuncheng 5 months ago
parent
commit
2f85651343
  1. 49
      src/pages/productReceipt/job/ccProductReceiptDetail.vue
  2. 80
      src/pages/productReceipt/job/fgProductReceiptDetail.vue

49
src/pages/productReceipt/job/ccProductReceiptDetail.vue

@ -56,7 +56,7 @@
style="background-color:ghostwhite; width: 100%; "> style="background-color:ghostwhite; width: 100%; ">
<view class=""> <view class="">
<locationCompare ref="comScanLocation" title="收货库位" <locationCompare ref="comScanLocation" title="收货库位"
:isShowEdit="jobContent.allowModifyLocation=='TRUE'" :recommendLocationCode="jobToLocationCode" :recommendLocationCode="jobToLocationCode"
:locationCode="toLocationCode" @getLocation='scanLocationCode' :locationCode="toLocationCode" @getLocation='scanLocationCode'
:locationAreaTypeList="toLocationAreaTypeList"></locationCompare> :locationAreaTypeList="toLocationAreaTypeList"></locationCompare>
</view> </view>
@ -303,12 +303,27 @@
scanLocationCode(location, code) { scanLocationCode(location, code) {
this.toLocationCode = code if(this.jobContent.allowModifyLocation=="TRUE"){
this.detailSource.forEach(item => { this.toLocationCode = code
item.subList.forEach(detail => { this.detailSource.forEach(item => {
detail.toLocationCode = code item.subList.forEach(detail => {
detail.toLocationCode = code
})
}) })
}) }else {
//
if(code!=this.jobToLocationCode){
this.showMessageHint("任务中不允许修改库位\n扫描库位["+code+"]推荐库位是["+this.jobToLocationCode+"]",callBack=>{
})
}else {
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
}
}
}, },
checkLocation() { checkLocation() {
@ -412,17 +427,17 @@
this.managementList = res.list; this.managementList = res.list;
var params = this.setParams(); var params = this.setParams();
console.log("提交参数", JSON.stringify(params)); console.log("提交参数", JSON.stringify(params));
ccProductReceiptJobsubmit(params).then(res => { // ccProductReceiptJobsubmit(params).then(res => {
uni.hideLoading() // uni.hideLoading()
if (res.data) { // if (res.data) {
this.showCommitSuccessMessage("提交成功\n生成装配收货记录\n" + res.data) // this.showCommitSuccessMessage("\n\n" + res.data)
} else { // } else {
this.showErrorMessage("提交失败[" + res.msg + "]") // this.showErrorMessage("[" + res.msg + "]")
} // }
}).catch(error => { // }).catch(error => {
uni.hideLoading() // uni.hideLoading()
this.showErrorMessage(error) // this.showErrorMessage(error)
}) // })
} else { } else {
uni.hideLoading(); uni.hideLoading();
this.showErrorMessage(res.message); this.showErrorMessage(res.message);

80
src/pages/productReceipt/job/fgProductReceiptDetail.vue

@ -52,9 +52,9 @@
<view class="uni-flex u-col-center space-between padding_10" <view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; "> style="background-color:ghostwhite; width: 100%; ">
<view class=""> <view class="">
<locationCompare ref ="comScanLocation" title="收货库位" :isShowEdit="jobContent.allowModifyLocation=='TRUE'" <locationCompare ref="comScanLocation" title="收货库位" :recommendLocationCode="jobToLocationCode"
:recommendLocationCode="jobToLocationCode" :locationCode="toLocationCode" :locationCode="toLocationCode" @getLocation='scanLocationCode'
@getLocation='scanLocationCode' :locationTypeList="toLocationTypeList"></locationCompare> :locationTypeList="toLocationTypeList"></locationCompare>
</view> </view>
<view class=" uni-flex uni-row"> <view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> <button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
@ -231,9 +231,9 @@
that.subList = res.data.subList; that.subList = res.data.subList;
that.jobStatus = res.data.status that.jobStatus = res.data.status
that.jobToLocationCode = that.subList[0].toLocationCode that.jobToLocationCode = that.subList[0].toLocationCode
that.productionLineCode = that.subList[0].productionLineCode; that.productionLineCode = that.subList[0].productionLineCode;
// if (that.jobContent.allowModifyLocation == 'FALSE') { // if (that.jobContent.allowModifyLocation == 'FALSE') {
// that.toLocationCode = that.subList[0].toLocationCode // that.toLocationCode = that.subList[0].toLocationCode
// } // }
that.toLocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes) that.toLocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes)
that.detailSource = getDataSource(that.subList) that.detailSource = getDataSource(that.subList)
@ -333,12 +333,32 @@
}, },
scanLocationCode(location, code) { scanLocationCode(location, code) {
this.toLocationCode = code //
this.detailSource.forEach(item => { if (this.jobContent.allowModifyLocation == "TRUE") {
item.subList.forEach(detail => { this.toLocationCode = code
detail.toLocationCode = code this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
}) })
}) } else {
//
if (code != this.jobToLocationCode) {
this.showMessageHint("任务中不允许修改库位\n扫描库位[" + code + "]推荐库位是[" + this.jobToLocationCode + "]",
callBack => {})
} else {
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
}
}
}, },
checkLocation() { checkLocation() {
@ -441,14 +461,14 @@
// this.showErrorMessage("0,") // this.showErrorMessage("0,")
// return; // return;
// } // }
var valiDate = getSwitchInfoByCode("fgProductReceipCommitValidate") var valiDate = getSwitchInfoByCode("fgProductReceipCommitValidate")
// //
if(valiDate){ if (valiDate) {
if (!this.checkLocation()) { if (!this.checkLocation()) {
return return
} }
}else{ } else {
this.toLocationCode = this.toLocationCode?this.toLocationCode:this.jobToLocationCode this.toLocationCode = this.toLocationCode ? this.toLocationCode : this.jobToLocationCode
} }
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
item.subList.forEach(subitem => { item.subList.forEach(subitem => {
@ -492,17 +512,17 @@
this.managementList = res.list; this.managementList = res.list;
var params = this.setParams(); var params = this.setParams();
console.log("提交参数", JSON.stringify(params)); console.log("提交参数", JSON.stringify(params));
productReceiptJobsubmit(params).then(res => { // productReceiptJobsubmit(params).then(res => {
uni.hideLoading() // uni.hideLoading()
if (res.data) { // if (res.data) {
this.showCommitSuccessMessage("提交成功\n生成装配收货记录\n" + res.data, ) // this.showCommitSuccessMessage("\n\n" + res.data, )
} else { // } else {
this.showErrorMessage("提交失败[" + res.msg + "]") // this.showErrorMessage("[" + res.msg + "]")
} // }
}).catch(error => { // }).catch(error => {
uni.hideLoading() // uni.hideLoading()
this.showErrorMessage(error) // this.showErrorMessage(error)
}) // })
} else { } else {
uni.hideLoading(); uni.hideLoading();
this.showErrorMessage(res.message); this.showErrorMessage(res.message);

Loading…
Cancel
Save