Browse Source

修改入库数量大于采购数量通过申请问题

dev
long 2 years ago
parent
commit
078c7557d1
  1. 55
      src/views/activiti/form/ProcessMaterialWarehousingForm.vue

55
src/views/activiti/form/ProcessMaterialWarehousingForm.vue

@ -4,7 +4,7 @@
<!-- 主表单区域 -->
<a-form :form="form" slot="detail" style="background-color: #f8f3e7;padding-top: 10px;padding-right: 50px">
<a-row>
<a-col :span="8" v-show="false">
<a-col :span="8" >
<a-form-item label="ID" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-decorator="['id']" placeholder="" style="width: 100%"/>
</a-form-item>
@ -205,6 +205,8 @@
selectedMainId: '',
processUdgetPlanId: '',
processUdgetPlanIds: '',
planQuantity:0,
warehousingQuantity:0,
isTargetLibrary: false,
isGetOneAndLast:false,
isIfDirect:false,
@ -344,6 +346,8 @@
list: '/hy/processUdgetPlan/queryProcessUdgetPlanMaterialByMainIds',
puwwlist: '/unitwaste/processUnitWasteWarehouseCode/queryById',
getFirstNode: '/actProcessIns/getFirstNode',
queryQuantityByProcessUdgetPlanId:'/hy/processMaterialWarehousing/queryQuantityByProcessUdgetPlanId',
queryQuantityByPlanId:'/hy/processUdgetPlan/queryQuantityByPlanId',
processMaterialWarehousingList: {
list: '/hy/processMaterialWarehousing/queryProcessMaterialWarehousingListByMainId'
}
@ -449,8 +453,34 @@
},
methods: {
//tab
onSelect(record) {
// console.log(record.row);
async onSelect(record) {
console.log(record.row,"----------------------->>",this.processUdgetPlanIds);
let warehousingQuantity=0;
//
//1
let params={};
params.materialGroup=record.row.materialGroup;
params.materialNumber=record.row.materialNumber;
params.planId=this.processUdgetPlanIds;
await this.getAction(this.url.queryQuantityByPlanId,params).then((res) => {
if (res.success) {
if(res.result!=null){
this.planQuantity=res.result;
}
}
})
//2
// materialGroup
// materialNumber
await this.getAction(this.url.queryQuantityByProcessUdgetPlanId,params).then((res) => {
if (res.success) {
if(res.result!=null){
this.warehousingQuantity=res.result;
}
}
})
console.log('表单回显数据11', this.planQuantity)
console.log('表单回显数据2', this.warehousingQuantity)
if (record.row.materialPrice !== '' && record.row.materialQuantity !== '') {
if (record.row.id !== undefined) {
let values = [
@ -461,8 +491,16 @@
}
}
]
// console.log(values);
if(this.planQuantity-this.warehousingQuantity-record.row.materialQuantity<0){
this.$message.error('入库数量不能大于采购数量')
this.isGetOneAndLast=false;
return;
}else {
this.isGetOneAndLast=true;
}
console.log(record.row.materialQuantity,"----------++++");
this.$refs.processMaterialWarehousingList.setValues(values)
}
}
@ -518,6 +556,10 @@
} else {
this.describes = this.describes + '---' + formData.processMaterialWarehousingListList[i].materialName
}
if (formData.processMaterialWarehousingListList[i].materialPrice*formData.processMaterialWarehousingListList[i].materialQuantity!=formData.processMaterialWarehousingListList[i].materialAmount){
this.$message.error('请检查入库数量');
return;
}
}
formData.describes = this.describes
if (formData.materialType == 1) {
@ -592,6 +634,10 @@
} else {
this.describes = this.describes + '---' + formData.processMaterialWarehousingListList[i].materialName
}
if (formData.processMaterialWarehousingListList[i].materialPrice*formData.processMaterialWarehousingListList[i].materialQuantity!=formData.processMaterialWarehousingListList[i].materialAmount){
this.$message.error('请检查入库数量');
return;
}
}
formData.describes = this.describes
console.log('格式化后的数据', formData)
@ -764,6 +810,7 @@
this.processUdgetPlanIds = ids.join(',')
let params = {}
params.ids = JSON.stringify(ids)
console.log(params,"*****************>>")
await this.requestSubTableDatas(this.url.list, params, this.processMaterialWarehousingListTable)
// getAction(this.url.list,params).then((res)=>{
// if(res.success){

Loading…
Cancel
Save