Browse Source

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	src/views/activiti/form/ProcessMaterialsDeliveryForm.vue
dev
caoyizhong 2 years ago
parent
commit
5040026211
  1. 157
      src/views/activiti/form/ProcessMaterialsDeliveryForm.vue

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

@ -326,8 +326,8 @@
]
},
url: {
queryByIdDescription: "/description/processDescription/queryById",
queryByIdMerchandiseNews: "/merchandisenews/processMerchandiseNews/queryById",
queryByIdDescription: '/description/processDescription/queryById',
queryByIdMerchandiseNews: '/merchandisenews/processMerchandiseNews/queryById',
getForm: '/actBusiness/getForm',
add: '/hy/processMaterialsDelivery/add',
edit: '/hy/processMaterialsDelivery/edit',
@ -340,15 +340,15 @@
wasteMaterialsList: '/wastematerials/processWasteMaterials/merchandiseNewsName', //
puwwlist: '/unitwaste/processUnitWasteWarehouseCode/queryById',
unitWasteWarehouseList: '/unitwaste/processUnitWasteWarehouseCode/queryById', //
getFirstNode:'/actProcessIns/getFirstNode',
getFirstNode: '/actProcessIns/getFirstNode',
processMaterialsDeliveryList: {
list: '/hy/processMaterialsDelivery/queryProcessMaterialsDeliveryListByMainId'
}
},
btndisabled: false,
describes: '',
assignees:'',
deliveryType:'',
assignees: '',
deliveryType: '',
validatorRules: {
// 'blur'
materialType: { rules: [{ required: true, message: '请选择物资类型!' }] },
@ -414,7 +414,7 @@
return true
}
// console.log("============================",this.hiegs=this.hieg);
this.hiegs = this.hieg;
this.hiegs = this.hieg
return this.disabled
},
showFlowSubmitButton() {
@ -430,7 +430,7 @@
dianshang: {
immediate: true,
handler: function(val) {
if (val==1){
if (val == 1) {
}
this.deliveryType = val
@ -447,7 +447,7 @@
// userInfo.company=company;
if (!this.isNew) {
this.init()
}else {
} else {
this.popupCallback(company, userInfo, puwwcid)
}
},
@ -534,7 +534,7 @@
}
}
if ( !! record.row.equipment && isMA && record.row.materialGroup !== this.materialGroupId ) {
if (!!record.row.equipment && isMA && record.row.materialGroup !== this.materialGroupId) {
// console.log("materialNumber")
if(!b){
if (this.accountingAttributesVal === "1" ) {
@ -618,17 +618,17 @@
eAll = 2;
} else {
//
await this.getEquipmentAll(record.row.equipment);
await this.getEquipmentAll(record.row.equipment)
eAll = 1
}
}
this.materialGroupId = record.row.equipment;
this.materialGroupId = record.row.equipment
}
//
if (!! record.row.pleaseSendNumber && isMA) {
if (!!record.row.pleaseSendNumber && isMA) {
// console.log("333333333333")
let res = record.row
let materialName = {}
@ -639,7 +639,7 @@
}
}
})
if(eAll === 0){
if (eAll === 0) {
if (parseInt(res.pleaseSendNumber) > parseInt(materialName.residueNumber)) {
this.$message.warn('输入请发数不能大于库存数')
res.pleaseSendNumber = materialName.residueNumber
@ -647,7 +647,7 @@
} else {
res.actualSendNumber = res.pleaseSendNumber
}
}else if(eAll === 1){
} else if (eAll === 1) {
// console.log("000000000000000",this.equipmentAll);
if (parseInt(res.pleaseSendNumber) > parseInt(this.equipmentAll[0].materialQuantity)) {
this.$message.warn('输入请发数不能大于库存数')
@ -656,7 +656,7 @@
} else {
res.actualSendNumber = res.pleaseSendNumber
}
}else if(eAll === 2) {
} else if (eAll === 2) {
// console.log("00000000000022222",this.equipmentAll);
if (parseInt(res.pleaseSendNumber) > parseInt(this.equipmentAll[0].residueNumber)) {
this.$message.warn('输入请发数不能大于库存数')
@ -692,41 +692,41 @@
},
//
getEquipmentAll(val,){
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
departId: res.departIds
}
getAction(this.url.merchandiseNewsList,pam).then(res=>{
getAction(this.url.merchandiseNewsList, pam).then(res => {
// console.log("dsfgsdfgb",res);
if(res.success){
this.equipmentAll =res.result ;
if (res.success) {
this.equipmentAll = res.result
}
resolve(this.equipmentAll);
resolve(this.equipmentAll)
})
})
},
//
getEquipmentInvisible(val){
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
departId: res.departIds
}
getAction(this.url.wasteMaterialsList,pam).then(res=>{
getAction(this.url.wasteMaterialsList, pam).then(res => {
// console.log("pppppppppppp",res);
if(res.success){
this.equipmentAll =res.result ;
if (res.success) {
this.equipmentAll = res.result
}
resolve(this.equipmentAll);
resolve(this.equipmentAll)
})
})
@ -797,7 +797,7 @@
})
},
fetchMerchandiseNewsZW(value,did) { //
fetchMerchandiseNewsZW(value, did) { //
//
return new Promise((resolve, reject) => {
//
@ -808,11 +808,11 @@
}
let ue = sessionStorage.getItem('USER_INFORMATION')
let res = JSON.parse(ue)
// console.log("78979789",res);
//
par.departId = res.departIds;
if( !res.departIds){
this.$message.warn("当前账号没有物资库!!!");
// console.log("78979789",res);
//
par.departId = res.departIds
if (!res.departIds) {
this.$message.warn('当前账号没有物资库!!!')
}
this.bigIdMerchandiseNewsList = []
let qc = []
@ -1191,7 +1191,7 @@
accountingAttributes: value
}
getAction(this.url.descriptionRake, par).then((res) => {
console.log("1231234123",res)
console.log('1231234123', res)
if (res.success) {
if (this.processMaterialsDeliveryListTable.columns[0].options.length > 0) {
this.processMaterialsDeliveryListTable.columns[0].options = []
@ -1259,15 +1259,16 @@
/*回显数据*/
init() {
this.btndisabled = true
var r = this.processData;
this.getAssignees(r);
if (!r.tableId){
var r = this.processData
this.getAssignees(r)
if (!r.tableId) {
return
}
this.getAction(this.url.queryById, {
id: r.tableId
}).then((res) => {
if (res.success) {
this.$emit('delivery', res.result.deliveryType)
let formData = res.result
formData.tableName = r.tableName
this.data = formData
@ -1329,22 +1330,23 @@
formData.procDeTitle = this.processData.name
formData.title = this.processData.description
formData.targetLibrary = this.libraryAssociationIdInvisible
formData.deliveryType = this.deliveryType
if (!formData.tableName) formData.tableName = this.processData.businessTable
console.log('格式化后的数据', formData)
var url = this.url.addDeliveryApply
let method = 'post'
if (!this.isNew) {
url = this.url.editDeliveryApply
method = 'put';
formData.assignees=this.assignees
formData.tableName = this.processData.tableName;
formData.procDefId = this.processData.procDefId;
formData.procDeTitle = this.processData.processName;
formData.title=this.processData.title;
formData.processInstanceId=this.processData.id;
if (!this.assignees){
method = 'put'
formData.assignees = this.assignees
formData.tableName = this.processData.tableName
formData.procDefId = this.processData.procDefId
formData.procDeTitle = this.processData.processName
formData.title = this.processData.title
formData.processInstanceId = this.processData.id
if (!this.assignees) {
this.$message.error('审批节点未分配候选审批人员,请联系管理员!')
return;
return
}
}
console.log('提交方法', method)
@ -1354,7 +1356,7 @@
this.$message.success('提交申请成功!')
//todo
this.$emit('loadData')
this.close();
this.close()
} else {
this.$message.error(res.message)
}
@ -1403,6 +1405,7 @@
formData.procDeTitle = this.processData.name
formData.title = this.processData.description
formData.targetLibrary = this.libraryAssociationIdInvisible
formData.deliveryType = this.deliveryType
if (!formData.tableName) formData.tableName = this.processData.businessTable
console.log('格式化后的数据', formData)
var url = this.url.add
@ -1445,7 +1448,7 @@
}
console.log('回显数据', this.data)
let fieldval = pick(this.data, 'id', 'company', 'createTime', 'departId', 'createBy', 'materialType', 'deliveryTime', 'fileId', 'opinion')
let fieldval = pick(this.data, 'id', 'deliveryType', 'company', 'createTime', 'departId', 'createBy', 'materialType', 'deliveryTime', 'fileId', 'opinion')
this.$nextTick(() => {
this.form.setFieldsValue(fieldval)
})
@ -1470,31 +1473,33 @@
}
}
console.log("tab.dataSource",dataSource)
dataSource.forEach(item =>{
let par = { id : item.materialGroup,}
let param = {id : item.equipment,}
getAction(this.url.queryByIdDescription,par).then( res=>{
console.log('tab.dataSource', dataSource)
dataSource.forEach(item => {
let par = { id: item.materialGroup }
let param = { id: item.equipment }
getAction(this.url.queryByIdDescription, par).then(res => {
// console.log(res);
if(res.success){
this.processMaterialsDeliveryListTable.columns[0].options= [{
title : res.result.materialClassify,
value : item.materialGroup,
disabled : true }];
if (res.success) {
this.processMaterialsDeliveryListTable.columns[0].options = [{
title: res.result.materialClassify,
value: item.materialGroup,
disabled: true
}]
}
})
getAction(this.url.queryByIdMerchandiseNews,param).then( res=>{
console.log(res);
if(res.success){
this.processMaterialsDeliveryListTable.columns[1].options= [{
title : res.result.materialsNumber,
value : item.equipment,
disabled : true }];
getAction(this.url.queryByIdMerchandiseNews, param).then(res => {
console.log(res)
if (res.success) {
this.processMaterialsDeliveryListTable.columns[1].options = [{
title: res.result.materialsNumber,
value: item.equipment,
disabled: true
}]
}
})
})
tab.dataSource = dataSource;
tab.dataSource = dataSource
typeof success === 'function' ? success(res) : ''
}).finally(() => {
tab.loading = false
@ -1502,8 +1507,6 @@
},
/** 整理成formData */
classifyIntoFormData(allValues) {
let main = Object.assign(this.model, allValues.formValue)
@ -1547,20 +1550,24 @@
this.form.setFieldsValue(fieldval)
})
},
getAssignees(v){
getAction(this.url.getFirstNode,{procDefId:v.procDefId,tableId:v.tableId,tableName:v.tableName}).then(res => {
getAssignees(v) {
getAction(this.url.getFirstNode, {
procDefId: v.procDefId,
tableId: v.tableId,
tableName: v.tableName
}).then(res => {
if (res.success) {
if (res.result.users && res.result.users.length > 0) {
//
let ids = [];
let ids = []
res.result.users.forEach(e => {
ids.push(e.username);
});
this.assignees = ids.join(",");
ids.push(e.username)
})
this.assignees = ids.join(',')
}
}
});
})
}
}

Loading…
Cancel
Save