Browse Source

修改调拨实发数不对

dev
caoyizhong 2 years ago
parent
commit
e051b21935
  1. 8
      src/views/activiti/form/ProcessMaterialsAllotForm.vue
  2. 2
      src/views/activiti/form/ProcessMaterialsDeliveryForm.vue
  3. 124
      src/views/activiti/form/ProcessSmaterialsScrapForm.vue

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

@ -694,14 +694,15 @@
// }
// }
//
if(record.column.key == 'allotSendNumber'){
if(record.column.key == 'allotSendNumber' && !!record.row.id){
if(!!record.value && parseInt( record.value) < 1){
this.$message.warning("实发数大于0");
record.row.allotSendNumber = null ;
}
if(!!record.value && parseInt( record.value) > 0){
this.shiyan.forEach( item =>{
if(parseInt( record.value) > parseInt(item.materialQuantity )){
if( item.merchandiseNewsId == record.row.equipment && parseInt( record.value) > parseInt(item.materialQuantity )){
console.log(item, record,"--------")
this.$message.warning("实发数大于库存数");
record.row.allotSendNumber = !record.value ? 1 : item.materialQuantity ;
}
@ -1178,6 +1179,7 @@
//
if (this.data.id) {
let params = { id: this.data.id }
this.shiyan = [];
this.requestSubTableData(this.url.processMaterialsAllotList.list, params, this.processMaterialsAllotListTable)
}
},
@ -1195,7 +1197,7 @@
}
}
this.hiegkucun = [];
this.shiyan = [];
// console.log("tab.dataSource",dataSource)
dataSource.forEach(item =>{
let par = { id : item.materialGroup,}

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

@ -763,7 +763,7 @@
}
}
]
this.$refs.processMaterialsDeliveryList.setValues(values)
this.$refs.processMaterialsDeliveryList.setValues(values);
} else {
// console.log("this.data.materialType",this.data.materialType)
if (parseInt(this.deliveryType) !== 1) {

124
src/views/activiti/form/ProcessSmaterialsScrapForm.vue

@ -129,6 +129,7 @@
return {
heid: true,
isabled : true,
disabl : true, //
section: { }, //id
labelCol: {
xs: { span: 24 },
@ -185,6 +186,7 @@
width: '200px',
placeholder: '请输入${title}',
defaultValue: '',
disabled: this.disabled,
options:[]
},
{
@ -192,6 +194,7 @@
key: 'wbs',
type: FormTypes.input,
dictCode: '',
disabled: this.disabled,
width: '200px',
placeholder: '请输入${title}',
defaultValue: ''
@ -200,7 +203,7 @@
title: '物料名称及规格型号',
key: 'materialName',
type: FormTypes.sel_search,
disabled: true,
disabled: this.disabled,
dictCode: '',
width: '200px',
placeholder: '请输入${title}',
@ -220,7 +223,7 @@
title: '报废数量',
key: 'scrapNumber',
type: FormTypes.inputNumber,
disabled: false,
disabled: this.disabled,
width: '130px',
placeholder: '请输入${title}',
defaultValue: ''
@ -229,7 +232,7 @@
title: '单价(元)',
key: 'materialPrice',
type: FormTypes.inputNumber,
disabled: false,
disabled: true,
width: '130px',
placeholder: '请输入${title}',
defaultValue: ''
@ -249,7 +252,8 @@
type: FormTypes.date,
width: '200px',
placeholder: '请输入${title}',
defaultValue: ''
defaultValue: '',
disabled: this.disabled
},
{
title: '供货商',
@ -267,7 +271,8 @@
type: FormTypes.input,
width: '200px',
placeholder: '请输入${title}',
defaultValue: ''
defaultValue: '',
disabled: this.disabled
}
// {
// title: 'id',
@ -304,6 +309,8 @@
// processReturnId: {rules:[{ required: true, message: '!' }]},
// processPlan: {rules:[ { required: true, message: '!'}]}
},
equipmentList:[],
}
},
props: {
@ -378,16 +385,73 @@
}
},
methods: {
onSelect(record){
if(record.column.key = 'equipment' && !!record.row.id ){
console.log(record.row,record);
let materialName ={};
this.equipmentList.forEach( item =>{
// console.log(item)
if(item.merchandiseNewsId == record.value){
console.log(item);
materialName = {
equipment : item.merchandiseNewsId,
materialName: item.materialDescription,
materialUnit: item.materialsUnit,
materialGroup: item.materialGroup,
supplierName: item.supplierId,
materialPrice: item.materialPrice,
descriptionId: item.descriptionId,
}
}
})
let values = [
{
rowKey: record.row.id,
values: {
'equipment': materialName.equipment,
'materialGroup': materialName.materialGroup,
'materialName': materialName.materialName,
'materialUnit': materialName.materialUnit,
'supplierId': materialName.supplierName,
'materialPrice': materialName.materialPrice,
// 'actualSendNumber': materialName.residueNumber,
// 'repertory': materialName.residueNumber
// 'materialAmount': materialName.price * materialName.residueNumber
}
}
]
this.$refs.processSmaterialsScrapList.setValues(values);
}
// if(!!record.row.scrapNumber && !!record.row.materialPrice && !! record.row.id){
// let shut = {};
// let values = [
// {
// rowKey: record.row.id,
// values: {
// 'scrapNumber': record.row.scrapNumber > 0 ? record.row.scrapNumber : 1 ,
// 'materialAmount': accMul(record.row.scrapNumber,record.row.materialPrice) > 0 ? accMul(record.row.scrapNumber,record.row.materialPrice) : 1 * record.row.materialPrice,
// },
// },
// ]
// this.$refs.processSmaterialsScrapList.setValues(values);
// }
},
//
async isMaterialType(val) {
console.log("this.section",this.section);
// console.log("this.section",this.section);
if (val !== undefined) {
this.isabled = false;
this.searchInformation(val);
}
},
//
@ -406,6 +470,7 @@
getAction(this.url.wasteMaterialsUrlList,par).then(res =>{
if(res.success){
console.log("156465",res.result.records);
this.equipmentList = res.result.records;
let nu = res.result.records || res.result;
let qc = [];
if (this.processSmaterialsScrapListTable.columns[1].options.length > 0) {
@ -418,7 +483,6 @@
disabled: false
})
})
this.processSmaterialsScrapListTable.columns[1].options = qc;
}
})
@ -439,44 +503,6 @@
}
},
onSelect(record){
// console.log(record.row);
if(!!record.row.scrapNumber && !!record.row.materialPrice && !! record.row.id){
let shut = {};
// if(this.processSmaterialsScrapListTable.dataSource.length > 0){
// let it = this.processSmaterialsScrapListTable.dataSource;
// it.forEach( item =>{
// //
// if(item.materialGroup === record.row.materialGroup){
// shut = item;
// }
// })
// }
// if(!!shut && record.row.scrapNumber > shut.scrapNumber){
// record.row.scrapNumber = shut.scrapNumber;
// }else if(!!shut && record.row.scrapNumber < shut.scrapNumber){
//
// }else{
//
// return;
// }
let values = [
{
rowKey: record.row.id,
values: {
'scrapNumber': record.row.scrapNumber > 0 ? record.row.scrapNumber : 1 ,
'materialAmount': accMul(record.row.scrapNumber,record.row.materialPrice) > 0 ? accMul(record.row.scrapNumber,record.row.materialPrice) : 1 * record.row.materialPrice,
},
},
]
this.$refs.processSmaterialsScrapList.setValues(values);
}
},
materialType(val) {
if (val !== undefined) {

Loading…
Cancel
Save