Browse Source

修改物料多次选择

dev
caoyizhong 2 years ago
parent
commit
e5a2a94ffc
  1. 29
      src/views/activiti/form/ProcessMaterialsAllotForm.vue
  2. 86
      src/views/activiti/form/ProcessMaterialsDeliveryForm.vue

29
src/views/activiti/form/ProcessMaterialsAllotForm.vue

@ -284,6 +284,7 @@
edit: '/hy/processMaterialsAllot/edit',
queryById: '/hy/processMaterialsAllot/queryById',
descriptionRake: '/wastematerials/processWasteMaterials/wasteMaterialsName', //
descriptionRakeUrl: '/hy/processMaterialWarehousingList/queryByIdWarehousingList', //
merchandiseNewsList: '/wastematerials/processWasteMaterials/merchandiseNewsName',
unitWasteNameUrl: '/unitwaste/processUnitWasteWarehouseCode/unitWasteName',
puwwlistByuntil:'/unitwaste/processUnitWasteWarehouseCode/list',
@ -300,7 +301,7 @@
processPlan: { rules: [{ required: true, message: '请选择流程计划!' }] }
},
bigIdMerchandiseNewsList:[],
materialGroupId: '',
materialGroupId: undefined,
}
},
props: {
@ -373,10 +374,10 @@
// console.log(record)
let isDB = true;
if(record.row.materialGroup !== '' && record.row.materialGroup !== undefined){
// console.log("materialGroup")
if(record.row.id !== '' && record.row.id !== undefined && this.materialGroupId != record.row.materialGroup ){
this.fetchMerchandiseNews(record.row.materialGroup,1);
if(record.row.id !== '' && record.row.id !== undefined && this.materialGroupId !== record.row.materialGroup ){
console.log("执行materialGroup")
this.fetchMerchandiseNews(record.row.materialGroup,1);
let value = [
{
rowKey: record.row.id,
@ -402,7 +403,7 @@
}
if(record.row.materialGroup !== '' && record.row.materialGroup !== undefined && record.row.equipment !== '' && record.row.allotNumber === '' && isDB ){
// console.log("materialNumber")
console.log("执行materialNumber")
let materialName = {}
this.bigIdMerchandiseNewsList.forEach(item => {
if (item.merchandiseNewsId === record.row.equipment) {
@ -494,10 +495,10 @@
this.processMaterialsAllotListTable.columns[1].options = [];
}
this.$refs.processMaterialsAllotList.getValues((a,b,c)=>{
// console.log(a,b,c)
console.log(a,b,c)
b.forEach(item =>{
if(item.equipment !== '' && item.equipment !== undefined && item.equipment !== null){
numberList.push(item.materialNumber);
numberList.push(item.equipment);
}
});
});
@ -542,14 +543,15 @@
},
descriptionFetchData(value){ //
//
//
let par = {
delFlag: 0,
accountingAttributes: value,
sysOrgCode: this.data.sysOrgCode
// sysOrgCode: this.data.sysOrgCode
}
getAction(this.url.descriptionRake,par).then((res)=>{
if(res.success){
if(this.processMaterialsAllotListTable.columns[0].options.length > 0){
this.processMaterialsAllotListTable.columns[0].options = [];
}
@ -562,14 +564,13 @@
}
});
getAction(this.url.unitWasteNameUrl,null).then((res)=>{
if(res.success){
if(this.processMaterialsAllotListTable.columns[7].options.length > 0){
this.processMaterialsAllotListTable.columns[7].options = [];
if(this.processMaterialsAllotListTable.columns[6].options.length > 0){
this.processMaterialsAllotListTable.columns[6].options = [];
}
res.result.forEach( item => {
this.processMaterialsAllotListTable.columns[7].options.push({
this.processMaterialsAllotListTable.columns[6].options.push({
title : item.departName,
value : item.libraryAssociationIdInvisible,
})
@ -578,7 +579,7 @@
});
this.materialGroupId = undefined;
},

86
src/views/activiti/form/ProcessMaterialsDeliveryForm.vue

@ -332,7 +332,7 @@
deliveryTime: { rules: [{ required: true, message: '请选择出库时间!' }] },
processPlan: { rules: [{ required: true, message: '请选择流程计划!' }] }
},
materialGroupId: '',
materialGroupId: undefined,
}
},
props: {
@ -408,6 +408,7 @@
addid(val){
this.addId = val.row.id;
// console.log(this.addId);
this.materialGroupId = undefined;
},
//
isMaterialType(val){
@ -415,17 +416,21 @@
this.accountingAttributesVal = val
this.heid = false;
this.fetchData(val);
}
},
async onSelect(record) {
// console.log(record)
let isMA= true;
if(record.row.materialGroup !== '' && record.row.materialGroup !== undefined){
// console.log("materialGroup111")
if(record.row.id !== undefined && record.row.id !== '' && record.row.materialGroup !== this.materialGroupId){
// console.log("materialGroup")
// console.log("materialGroup222")
if(this.rolePlay){
//
await this.fetchMerchandiseNewsZW(record.row.materialGroup, 1);
}else{
//
await this.fetchMerchandiseNews(record.row.materialGroup, 1);
}
@ -551,10 +556,10 @@
this.processMaterialsDeliveryListTable.columns[1].options = [];
}
this.$refs.processMaterialsDeliveryList.getValues((a,b,c)=>{
// console.log(a,b,c)
console.log(a,b,c)
b.forEach(item =>{
if(item.equipment !== '' && item.equipment !== undefined && item.equipment !== null){
numberList.push(item.materialNumber);
numberList.push(item.equipment);
}
});
});
@ -562,7 +567,7 @@
if(res.success){
console.log(res.result);
let newList = res.result;
// console.log("12312312:"+numberList.length);
console.log("12312312:"+numberList.length);
if(numberList.length > 0){
newList.forEach( item => {
qc.push({
@ -573,8 +578,10 @@
})
numberList.forEach( num => {
qc.forEach( i => {
console.log(num);
console.log(i.value);
if(num === i.value){
// console.log(num,i.value);
console.log(num,i.value);
i.disabled = true;
}
});
@ -598,7 +605,7 @@
});
},
fetchMerchandiseNewsZW(value){ //
fetchMerchandiseNewsZW(value){ //
//
return new Promise((resolve, reject) => {
//
@ -614,10 +621,10 @@
this.processMaterialsDeliveryListTable.columns[1].options = [];
}
this.$refs.processMaterialsDeliveryList.getValues((a,b,c)=>{
// console.log(a,b,c)
console.log(a,b,c)
b.forEach(item =>{
if(item.equipment !== '' && item.equipment !== undefined && item.equipment !== null){
numberList.push(item.materialNumber);
numberList.push(item.equipment);
}
});
});
@ -946,14 +953,16 @@
// });
//
// },
fetchData(value) { //
// console.log("this.data==============>",this.data) //id
let params = {}
params.id = sessionStorage.getItem('PUWWC_Id')//id
console.log("322222232323",params.id);
getAction(this.url.unitWasteWarehouseList, params).then((res) => {
console.log(res)
if (res.success) {
params.id =sessionStorage.getItem('USER_INFORMATION');//id
let ue= sessionStorage.getItem('USER_INFORMATION');
let res=JSON.parse(ue);
if(res.realname !== "管理员"){
// console.log("78979789",res);
//
let par = {
delFlag: 0,
@ -996,7 +1005,54 @@
})
this.rolePlay = false;
}
})
// getAction(this.url.unitWasteWarehouseList, params).then((res) => {
// console.log(res)
// if (res.success) {
// //
// let par = {
// delFlag: 0,
// accountingAttributes: value,
// sysOrgCode: this.data.sysOrgCode
// }
// getAction(this.url.wasteMaterialsUrl, par).then((res) => {
// console.log(res)
// if (res.success) {
// if (this.processMaterialsDeliveryListTable.columns[0].options.length > 0) {
// this.processMaterialsDeliveryListTable.columns[0].options = []
// }
// res.result.forEach(item => {
// this.processMaterialsDeliveryListTable.columns[0].options.push({
// title: item.descriptionName,
// value: item.descriptionId
// })
// })
// }
// })
// this.rolePlay = true;
// } else {
// //
// let par = {
// delFlag: 0,
// accountingAttributes: value
// }
// getAction(this.url.descriptionRake, par).then((res) => {
// if (res.success) {
// if (this.processMaterialsDeliveryListTable.columns[0].options.length > 0) {
// this.processMaterialsDeliveryListTable.columns[0].options = []
// }
// res.result.forEach(item => {
// this.processMaterialsDeliveryListTable.columns[0].options.push({
// title: item.descriptionName,
// value: item.descriptionId
// })
// })
// }
// })
// this.rolePlay = false;
// }
// })
},

Loading…
Cancel
Save