Browse Source

修改数据查询问题显示

dev
caoyizhong 2 years ago
parent
commit
f75ef7f528
  1. 149
      src/views/activiti/form/ProcessMaterialsDeliveryForm.vue
  2. 2
      src/views/suppliesstronger/ProcessSuppliesStrongerLists.vue

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

@ -441,44 +441,49 @@
async onSelect(record) {
// console.log(record)
let isMA = true
if (record.row.materialGroup !== '' && record.row.materialGroup !== undefined) {
if (!!record.row.materialGroup && !!record.row.materialGroup ) {
// console.log("materialGroup111")
if (record.row.id !== undefined && record.row.id !== '' && record.row.materialGroup !== this.materialGroupId) {
if (!!record.row.id && record.row.materialGroup !== this.materialGroupId && !record.row.equipment) {
// console.log("materialGroup222")
if (this.rolePlay) {
// console.log("")
//
await this.fetchMerchandiseNewsZW(record.row.materialGroup, 1)
} else {
// console.log("")
//
await this.fetchMerchandiseNews(record.row.materialGroup, 1)
}
let valu = [
{
rowKey: record.row.id,
values: {
'equipment': '',
'materialGroup': record.row.materialGroup,
'materialName': '',
'materialUnit': '',
'supplierId': '',
'materialPrice': '',
'actualSendNumber': '',
'materialAmount': '',
'pleaseSendNumber': ''
let valu = [
{
rowKey: record.row.id,
values: {
'equipment': '',
'materialGroup': record.row.materialGroup,
'materialName': '',
'materialUnit': '',
'supplierId': '',
'materialPrice': '',
'actualSendNumber': '',
'materialAmount': '',
'pleaseSendNumber': ''
}
}
}
]
// console.log(valu)
this.$refs.processMaterialsDeliveryList.setValues(valu)
this.materialGroupId = record.row.materialGroup
isMA = false
}
]
// console.log(valu)
this.$refs.processMaterialsDeliveryList.setValues(valu)
this.materialGroupId = record.row.materialGroup
isMA = false
}
}
if (record.row.materialGroup !== '' && record.row.materialGroup !== undefined && record.row.equipment !== '' && record.row.equipment !== undefined && isMA) {
let eAll = 0;
if (!!record.row.materialGroup && !! record.row.equipment && isMA) {
// console.log("materialNumber")
let materialName = {}
this.bigIdMerchandiseNewsList.forEach(item => {
if (item.merchandiseNewsId === record.row.equipment) {
@ -491,7 +496,8 @@
}
}
})
if (record.row.id !== undefined) {
if (record.row.id !== undefined && Object.keys(materialName).length > 0) {
// console.log("materialName",materialName);
let values = [
{
rowKey: record.row.id,
@ -508,13 +514,26 @@
}
]
this.$refs.processMaterialsDeliveryList.setValues(values)
}else{
console.log("this.data.materialType",this.data.materialType)
if (parseInt(this.data.materialType) === 1) {
//
await this.getEquipmentInvisible(record.row.equipment);
eAll = 2;
} else {
//
await this.getEquipmentAll(record.row.equipment);
eAll = 1
}
}
}
//
if (record.row.pleaseSendNumber !== '' && record.row.pleaseSendNumber !== undefined && isMA) {
// console.log("",record.row)
if (!! record.row.pleaseSendNumber && isMA) {
// console.log("333333333333")
let res = record.row
let materialName = {}
this.bigIdMerchandiseNewsList.forEach(item => {
@ -524,15 +543,32 @@
}
}
})
// console.log("materialName.residueNumber",materialName.residueNumber)
if (parseInt(res.pleaseSendNumber) > parseInt(materialName.residueNumber)) {
// console.log("")
this.$message.warn('输入请发数不能大于库存数')
res.pleaseSendNumber = materialName.residueNumber
res.actualSendNumber = materialName.residueNumber
} else {
// console.log("")
res.actualSendNumber = res.pleaseSendNumber
if(eAll === 0){
if (parseInt(res.pleaseSendNumber) > parseInt(materialName.residueNumber)) {
this.$message.warn('输入请发数不能大于库存数')
res.pleaseSendNumber = materialName.residueNumber
res.actualSendNumber = materialName.residueNumber
} else {
res.actualSendNumber = res.pleaseSendNumber
}
}else if(eAll === 1){
// console.log("000000000000000",this.equipmentAll);
if (parseInt(res.pleaseSendNumber) > parseInt(this.equipmentAll[0].materialQuantity)) {
this.$message.warn('输入请发数不能大于库存数')
res.pleaseSendNumber = this.equipmentAll[0].materialQuantity
res.actualSendNumber = this.equipmentAll[0].materialQuantity
} else {
res.actualSendNumber = res.pleaseSendNumber
}
}else if(eAll === 2) {
// console.log("00000000000022222",this.equipmentAll);
if (parseInt(res.pleaseSendNumber) > parseInt(this.equipmentAll[0].residueNumber)) {
this.$message.warn('输入请发数不能大于库存数')
res.pleaseSendNumber = this.equipmentAll[0].residueNumber
res.actualSendNumber = this.equipmentAll[0].residueNumber
} else {
res.actualSendNumber = res.pleaseSendNumber
}
}
if (res.id !== undefined) {
let value = [
@ -559,6 +595,47 @@
}
},
//
getEquipmentAll(val,){
return new Promise((resolve, reject) => {
let ue = sessionStorage.getItem('USER_INFORMATION')
let res = JSON.parse(ue)
let pam = {
merchandiseNewsId: val,
departId : res.departIds
}
getAction(this.url.merchandiseNewsList,pam).then(res=>{
// console.log("dsfgsdfgb",res);
if(res.success){
this.equipmentAll =res.result ;
}
resolve(this.equipmentAll);
})
})
},
//
getEquipmentInvisible(val){
return new Promise((resolve, reject) => {
let ue = sessionStorage.getItem('USER_INFORMATION')
let res = JSON.parse(ue)
let pam = {
merchandiseNewsId: val,
departId : res.departIds
}
getAction(this.url.wasteMaterialsList,pam).then(res=>{
// console.log("pppppppppppp",res);
if(res.success){
this.equipmentAll =res.result ;
}
resolve(this.equipmentAll);
})
})
},
fetchMerchandiseNews(value) { //
//
return new Promise((resolve, reject) => {

2
src/views/suppliesstronger/ProcessSuppliesStrongerLists.vue

@ -393,7 +393,7 @@
}
],
url: {
listUrl: "/actBusiness/listData",
listUrl: "/actBusiness/listDataAll",
list: "/suppliesstronger/processSuppliesStronger/lists",
delete: "/suppliesstronger/processSuppliesStronger/delete",
deleteBatch: "/suppliesstronger/processSuppliesStronger/deleteBatch",

Loading…
Cancel
Save