Browse Source

修改流程查询

dev
caoyizhong 2 years ago
parent
commit
9a0917669c
  1. 2
      src/views/activiti/form/ProcessMaterialWarehousingForm.vue
  2. 117
      src/views/activiti/form/ProcessMaterialsAllotForm.vue
  3. 199
      src/views/activiti/form/ProcessMaterialsDeliveryForm.vue
  4. 131
      src/views/activiti/form/ProcessUdgetPlanForm.vue

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

@ -61,7 +61,7 @@
<a-col :span="8" v-show="this.isTargetLibrary">
<a-form-item label="入库目标库" :labelCol="labelCol" :wrapperCol="wrapperCol">
<!-- <j-select-item v-decorator="['targetLibrary',validatorRules.targetLibrary]"/>-->
<j-select-depart v-decorator="['targetLibrary']" multi/>
<j-select-depart v-decorator="['targetLibrary']" :multiple="false" />
<!-- <a-radio v-for="item in puwwOptions" :key="item.id" :label="item.invisibleCode" :value="item.id"></a-radio>-->
</a-form-item>
</a-col>

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

@ -202,7 +202,8 @@
width: '200px',
placeholder: '请输入${title}',
disabled: true,
options: []
options: [],
defaultValue: undefined
// props:{title: 'show title'}
// scopedSlots: { customRender: 'edit' },//
// customRender:function (t,r,index) {
@ -509,68 +510,69 @@
}
})
},
qingKong(id){
let value = [
{
rowKey: id,
values: {
'equipment': undefined,
'materialGroup':undefined,
'materialName': undefined,
'materialUnit': '',
'supplierId': '',
'materialPrice': '',
// 'number': undefined,
'allotNumber': '',
'materialAmount': ''
}
}
]
this.$nextTick(() => {
this.$refs.processMaterialsAllotList.setValues(value)
})
},
jingYong(id){
let sj =this.processMaterialsAllotListTable.columns[1].options;
sj.forEach(item =>{
if(item.value == id){
item.disabled = true;
}
})
this.processMaterialsAllotListTable.columns[1].options = sj;
},
async onSelect(record) {
let isDB = true
if (!record.row.equipment && !!record.row.materialGroup && !!record.row.materialName
|| !record.row.materialName && !!record.row.materialGroup && !!record.row.equipment ) {
let value = [
{
rowKey: record.row.id,
values: {
'equipment': undefined,
'materialGroup':undefined,
'materialName': undefined,
'materialUnit': '',
'supplierId': '',
'materialPrice': '',
// 'number': undefined,
'allotNumber': '',
'materialAmount': ''
}
}
]
this.$nextTick(() => {
this.$refs.processMaterialsAllotList.setValues(value)
})
this.qingKong(record.row.id);
this.materialGroupId = record.row.materialGroup
isDB = false
}
// let a = await this.getUniter();
// console.log(a,"21354234");
if(record.column.key == 'materialName' && !record.row.allotNumber && isDB && this.materialGroupId !== record.row.equipment && !!record.row.id
|| record.column.key == 'equipment' && !record.row.allotNumber && isDB && this.materialGroupId !== record.row.equipment && !!record.row.id
){
// console.log("111111111",record.value);
// console.log("-=000-=-");
let cf = false;
this.$refs.processMaterialsAllotList.getValues((a, b, c) => {
b.forEach(item => {
// console.log("bbbb11111b",item.equipment,record.row.equipment,item.materialGroup)
// console.log("-=1111-=-",item);
if (item.equipment === record.value && !!item.materialGroup && !cf) {
cf = true;
}
})
})
// let we ={};
// await this.$refs.processMaterialsAllotList.getValuesPromise().then(it =>{
// console.log("it",it);
// we = it;
// });
//
// console.log("-=2222-=-",we);
await this.fetchMerchandiseNews(record.value);
// console.log("2222222222");
if(cf){
let values = [
{
rowKey: record.row.id,
values: {
'equipment': undefined,
'materialGroup': undefined,
'materialName': undefined,
'materialUnit': '',
'supplierId': '',
'materialPrice': '',
'allotNumber': '',
'materialAmount': ''
}
}
]
this.$refs.processMaterialsAllotList.setValues(values)
this.qingKong(record.row.id);
}else{
let materialName = {}
if(this.bigIdMerchandiseNewsList.length > 0){
@ -611,8 +613,9 @@
}
}
]
this.$refs.processMaterialsAllotList.setValues(values);
this.jingYong(record.row.id);
this.materialGroupId = materialName.materialsNumber;
this.$refs.processMaterialsAllotList.setValues(values)
}
}
@ -626,7 +629,7 @@
if(!!record.value && parseInt( record.value) > 0){
this.shiyan.forEach( item =>{
if( item.merchandiseNewsId == record.row.equipment && parseInt( record.value) > parseInt(item.materialQuantity )){
console.log(item, record,"--------")
// console.log(item, record,"--------")
this.$message.warning("实发数大于库存数");
record.row.allotSendNumber = !record.value ? 1 : item.materialQuantity ;
}
@ -635,7 +638,7 @@
}
//
if (!!record.row.allotNumber && isDB) {
if (!!record.row.allotNumber && isDB && !!record.row.id) {
let res = record.row
let materialName = {}
this.bigIdMerchandiseNewsList.forEach(item => {
@ -645,15 +648,6 @@
}
}
})
// console.log("==",this.hiegkucun.length);
// console.log("111",record.row.allotSendNumber);
// console.log("materialName.residueNumber",materialName.residueNumber)
// if(parseInt( res.allotNumber) > parseInt( materialName.number )){
// // console.log("")
// this.$message.warn("")
// res.allotNumber = materialName.number;
// }
if (!!res.id) {
let value = [
{
@ -671,17 +665,14 @@
}
}
]
this.$nextTick(() => {
this.$refs.processMaterialsAllotList.setValues(value)
})
}
}
},
fetchMerchandiseNews(value) { //
//
return new Promise((resolve, reject) => {
return new Promise(async (resolve, reject) => {
//
let par = {
departId: this.libraryInvisible,
@ -898,19 +889,23 @@
return
}else{
let all = false;
let al = false;
allValues.tablesValue[0].values.forEach( it => {
if(!it.allotNumber){
this.$message.warning("请填写完整调拨物资数据!");
all = true;
return
}
if(!it.allotTarget){
this.$message.warning("请选择接收调拨目标!");
all = true;
al = true;
return
}
});
if(all){
this.$message.warning("请填写完整调拨物资数据!");
return
}
if(al){
this.$message.warning("请选择接收调拨目标!");
return
}

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

@ -90,7 +90,7 @@
:rowNumber="true"
:qeihuan = this.qeihuan
:rowSelection="true"
:actionButton="true"
:actionButton="!task"
@descriptionFetch="addid"
>
<template v-slot:repertory="props">
@ -427,6 +427,7 @@
qeihuan: '',
hiegs: true,
hiegkucun: [],
historyNumList: [],
officePanDaun: null,
officeBUMen: null,
}
@ -540,7 +541,7 @@
if ( this.hiegkucun.length > 0 && !!pas[log.index].equipment) {
let id= false;
this.hiegkucun.forEach(item => {
// console.log(item,"==========");
console.log(item,"==========");
if(pas[log.index].equipment == item.merchandiseNewsId){
if(this.officePanDaun == 1){
this.wateNumber = item.materialQuantity;
@ -602,83 +603,66 @@
}
},
qingKong(id){
let values = [
{
rowKey: id,
values: {
'equipment': undefined,
'materialGroup': null,
'materialName': undefined,
'materialUnit': '',
'supplierId': '',
'materialPrice': '',
'actualSendNumber': '',
'materialAmount': '',
'pleaseSendNumber': ''
}
}
]
this.$refs.processMaterialsDeliveryList.setValues(values);
},
pastSlas() { //
return new Promise((resolve, reject) => {
this.$refs.processMaterialsDeliveryList.getValuesPromise().then(re => {
console.log("12122222")
this.historyNumList = re;
})
resolve(this.historyNumList);
})
},
jingYong(id){
let jy = this.processMaterialsDeliveryListTable.columns[1].options;
jy.forEach( item => {
// console.log(item,"-==-=-");
if(item.value == id){
item.disabled = true;
}
})
this.processMaterialsDeliveryListTable.columns[1].options = jy;
},
async onSelect(record) {
// console.log(record,"wer234")
let isMA = true;
if (!record.row.equipment && !!record.row.materialGroup && !!record.row.materialName
|| !record.row.materialName && !!record.row.materialGroup && !!record.row.equipment ) {
// console.log("select==",record.row);
let values = [
{
rowKey: record.row.id,
values: {
'equipment': '',
'materialGroup': '',
'materialName': '',
'materialUnit': '',
'supplierId': '',
'materialPrice': '',
'actualSendNumber': '',
'materialAmount': '',
'pleaseSendNumber': ''
}
}
]
this.qingKong(record.row.id);
this.processMaterialsDeliveryListTable.columns[3].options = []
console.log("select==清空数据",record.row);
this.$refs.processMaterialsDeliveryList.setValues(values);
isMA = false;
return;
}
// if (!!record.row.materialGroup && !!record.row.materialGroup ) {
// // console.log("materialGroup111")
// if (!!record.row.id && record.row.materialGroup !== this.materialGroupId && record.column.key !== "allotNumber") {
// // 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': ''
// }
// }
// ]
// // console.log(valu)
// this.$refs.processMaterialsDeliveryList.setValues(valu)
// this.materialGroupId = record.row.materialGroup
// isMA = false
// }
// }
let eAll = 0
// if (!!record.row.materialGroup && !! record.row.equipment && isMA) {
let b = false
for (const res of this.bigIdMerchandiseNewsList) {
if (res.merchandiseNewsId === record.row.equipment) {
b = true;
}
}
// console.log(this.bigIdMerchandiseNewsList.length,"1");
// console.log("materialNumber",b,record.row.materialGroup , this.materialGroupId)
if (record.column.key == 'equipment' && isMA && record.row.equipment !== this.materialGroupId ||
record.column.key == 'materialName' && isMA && record.row.equipment !== this.materialGroupId) {
if (record.column.key == 'equipment' && isMA && record.row.equipment !== this.materialGroupId && !!record.row.id ||
record.column.key == 'materialName' && isMA && record.row.equipment !== this.materialGroupId && !!record.row.id) {
if (!b) {
if (this.accountingAttributesVal === '1') {
//
@ -692,36 +676,14 @@
}
await this.$refs.processMaterialsDeliveryList.getValues((a, b, c) => {
// console.log("bbbbbbbbbbbbbb",b)
b.forEach(item => {
if (item.equipment === record.row.equipment && !!item.materialGroup && !record.row.materialGroup
|| item.equipment === record.value && !!item.materialGroup && !record.row.materialGroup ) {
// console.log("bbbb====bbbbbb",item.equipment, record.row.equipment, item.materialGroup)
let values = [
{
rowKey: record.row.id,
values: {
'materialGroup': '',
'equipment': '',
'materialNumber': '',
'materialSeries': '',
'materialName': '',
'materialUnit': '',
'supplierId': '',
'materialAmount': '',
'materialType': ''
}
}
]
// console.log("sadf1111")
this.$refs.processMaterialsDeliveryList.setValues(values)
this.qingKong(record.row.id);
return
}
})
})
// console.log(this.bigIdMerchandiseNewsList.length,"2");
let materialName = {}
this.bigIdMerchandiseNewsList.forEach(item => {
if (item.merchandiseNewsId === record.row.equipment || record.value === item.merchandiseNewsId ) {
@ -764,6 +726,7 @@
}
]
this.$refs.processMaterialsDeliveryList.setValues(values);
this.jingYong(record.row.equipment);
} else {
// console.log("this.data.materialType",this.data.materialType)
if (parseInt(this.deliveryType) !== 1) {
@ -776,75 +739,51 @@
eAll = 1
}
}
this.materialGroupId = record.row.equipment
this.materialGroupId = record.row.equipment;
}
// console.log("this.data.materialType",this.deliveryType);
//
if (record.column.key == 'pleaseSendNumber' && isMA || record.column.key == 'actualSendNumber' && isMA) {
if (record.column.key == 'pleaseSendNumber' && isMA || record.column.key == 'actualSendNumber' && isMA && !!record.row.id) {
let res = record.row;
// let materialName = {}
// this.bigIdMerchandiseNewsList.forEach(item => {
// if (item.merchandiseNewsId === record.row.equipment) {
// // console.log("item.residueNumber",item)
// materialName = {
// residueNumber: item.residueNumber === undefined ? 0 : item.residueNumber
// }
// }
// })
if (eAll === 0 && !this.actualNumber) {
let baer = false;
if (eAll === 0 && !this.actualNumber ) {
// console.log("hiegkucun111",this.hiegkucun);
this.hiegkucun.forEach( item =>{
// console.log("res.actualSendNumber",res.actualSendNumber,item);
if (parseInt(res.actualSendNumber) > parseInt(item.materialQuantity)) {
if ( record.row.equipment == item.merchandiseNewsId && parseInt(res.actualSendNumber) > parseInt(item.materialQuantity)) {
this.$message.warn('输入的实发数不能大于库存数')
// res.pleaseSendNumber = materialName.residueNumber
res.actualSendNumber = parseInt(item.materialQuantity);
} else {
res.actualSendNumber = res.actualSendNumber
baer = true;
}
})
} else if (eAll === 1 && !this.actualNumber) {
this.hiegkucun.forEach( item => {
if (parseInt(res.actualSendNumber) > parseInt(item.materialQuantity)) {
if (record.row.equipment == item.merchandiseNewsId && parseInt(res.actualSendNumber) > parseInt(item.materialQuantity)) {
this.$message.warn('输入的实发数不能大于库存数')
// res.pleaseSendNumber = materialName.residueNumber
res.actualSendNumber = item.materialQuantity;
} else {
res.actualSendNumber = res.pleaseSendNumber;
baer = true;
}
})
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
// }
// console.log("000000000000000",this.equipmentAll);
} else if (eAll === 2 && !this.actualNumber) {
this.hiegkucun.forEach( item => {
if (parseInt(res.actualSendNumber) > parseInt(item.materialQuantity)) {
if ( record.row.equipment == item.merchandiseNewsId && parseInt(res.actualSendNumber) > parseInt(item.materialQuantity)) {
this.$message.warn('输入的实发数不能大于库存数')
// res.pleaseSendNumber = materialName.residueNumber
res.actualSendNumber = item.materialQuantity;
} else {
res.actualSendNumber = res.pleaseSendNumber;
baer = true;
}
})
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) {
if(!baer){
res.actualSendNumber = 0;
}
if (!!res.id && baer ) {
let value = [
{
rowKey: res.id,
@ -1204,13 +1143,13 @@
if (formData.processMaterialsDeliveryListList.length > 0) {
formData.processMaterialsDeliveryListList.forEach(item => {
if (!item.actualSendNumber || parseInt(item.actualSendNumber) < 1) {
if (!item.actualSendNumber) {
qing = true
}
})
if (qing) {
// console.log('============', qing)
this.$message.warning('请填写实发数或实发数不能为0!!!')
this.$message.warning('请填写实发数!!!')
} else {
let method = 'put'
httpAction(this.url.edit, formData, method).then((res) => {
@ -1440,12 +1379,12 @@
//
if (this.data.id) {
let params = { id: this.data.id }
this.requestSubTableData(this.url.processMaterialsDeliveryList.list, params, this.processMaterialsDeliveryListTable)
this.requestSubTableDatas(this.url.processMaterialsDeliveryList.list, params, this.processMaterialsDeliveryListTable)
}
},
/** 查询某个tab的数据 */
requestSubTableData(url, params, tab, success) {
requestSubTableDatas(url, params, tab, success) {
// console.log("url, params, tab, success",url, params, tab, success)
tab.loading = true
getAction(url, params).then(res => {

131
src/views/activiti/form/ProcessUdgetPlanForm.vue

@ -290,6 +290,7 @@
putUnder: '',
historyBigId: [],
historyPrices: [],
historyNumList: [], //
wateNumber: 0,
historyPrice: {},
isHistoryBigId: false,
@ -872,7 +873,7 @@
},
async seeHistoryPrice(log) {
this.historyPrices = []
console.log(log)
console.log("历史记录",log);
let param = {
relationId: log.rowId,
pageSize: 5
@ -895,7 +896,7 @@
async seeWateNumber(log) {
//
//this.assigneesText
console.log(this.assigneesText)
// console.log(this.assigneesText)
let pas = await log.target.getValuesPromise(log.rowIds)
if (pas[log.index].materialNumber !== '' && pas[log.index].materialNumber !== null) {
//
@ -906,18 +907,19 @@
getAction(this.url.stock, par).then((res) => {
// console.log(res);
if (res.success) {
this.wateNumber = res.result.materialQuantity
console.log(res, '----------------')
if(!!res.result){
this.wateNumber = !!res.result.materialQuantity ? res.result.materialQuantity : 0;
}else{
this.wateNumber = 0;
}
// console.log(res, '----------------')
}
})
}
},
//
async chaKan(log) {
// console.log("00000000",log);
let pas = await log.target.getValuesPromise(log.rowIds)
// console.log("111111111",log.rowIds);
// console.log('222222222222', pas)
if (pas[log.index].materialNumber !== '' && pas[log.index].materialNumber !== null) {
this.historyBigId = []
@ -944,28 +946,42 @@
}
},
//
qingKong(id){
let values = [
{
rowKey: id,
values: {
'materialGroup': null,
'materialNumber': undefined,
'materialSeries': '',
'materialName': undefined,
'materialUnit': '',
'supplierId': '',
'materialAmount': '',
'materialType': ''
}
}
]
this.$refs.processUdgetPlanMaterial.setValues(values);
},
pastSla() { //
return new Promise((resolve, reject) => {
this.$refs.processUdgetPlanMaterial.getValuesPromise().then(re => {
console.log("111111111");
this.historyNumList = re;
})
resolve(this.historyNumList);
})
},
//table
async onSelect(record) {
let isEr = true
if (!record.row.materialNumber && !!record.row.materialGroup && !!record.row.materialName
|| !record.row.materialName && !!record.row.materialGroup && !!record.row.materialNumber ) {
console.log("select==清空数据",record.row);
let values = [
{
rowKey: record.row.id,
values: {
'materialGroup': '',
'materialNumber': '',
'materialSeries': '',
'materialName': '',
'materialUnit': '',
'supplierId': '',
'materialAmount': '',
'materialType': ''
}
}
]
this.$refs.processUdgetPlanMaterial.setValues(values);
// console.log("select==",record.row);
this.qingKong(record.row.id);
return
}
@ -983,11 +999,26 @@
}
}
this.isShifu = false;
await this.pastSla();
// console.log("wqweqwer",this.historyNumList);
if (record.column.key == 'materialNumber' && !!record.row.id
|| record.column.key == 'materialName' && !!record.row.id ) {
// console.log("111",record);
// if (!!record.row.materialName && this.isBu !== record.row.materialName) {
console.log("2出发了");
// console.log("2");
if(this.historyNumList.length > 0){
this.historyNumList.forEach(item =>{
// console.log("2222222",item.materialNumber,record.value,item.materialGroup,item.materialName,);
if (item.materialNumber === record.value && !!item.materialGroup) {
this.qingKong(record.row.id);
this.isShifu = false;
this.fetchMerchandiseNews();
// console.log("3333");
return
}
})
}
let materialName = {}
this.bigIdMerchandiseNewsList.forEach(item => {
if (item.id === record.value) {
@ -1010,37 +1041,6 @@
})
console.log("===========12312 =", materialName);
if (!!record.row.id && Object.keys(materialName).length > 0) {
await this.$refs.processUdgetPlanMaterial.getValues((a, b, c) => {
// console.log("bbbbbbbbbbbbbb",b)
b.forEach(item => {
if (item.materialNumber === record.value && !!item.materialGroup && item.materialName == materialName.merchandiseName) {
// console.log("bbbbbbbbbbbbbb",b)
let values = [
{
rowKey: record.row.id,
values: {
'materialGroup': '',
'materialNumber': '',
'materialSeries': '',
'materialName': '',
'materialUnit': '',
'supplierId': '',
'materialAmount': '',
'materialType': ''
}
}
]
// console.log("sadf1111")
this.$refs.processUdgetPlanMaterial.setValues(values);
this.isShifu = false;
this.fetchMerchandiseNews();
return
}
})
})
this.processUdgetPlanMaterialTable.columns[0].options.push({
title: materialName.materialClassify,
@ -1067,7 +1067,7 @@
}
//
if (!!record.row.materialQuantity && !!record.row.materialPrice && isEr) {
if (!!record.row.materialQuantity && !!record.row.materialPrice && isEr && !!record.row.id ) {
// record.row.materialAmount = record.row.materialQuantity * record.row.materialPrice;
console.log("3出发了");
//5
@ -1097,8 +1097,8 @@
}
},
fetchMerchandiseNews(value, id) { //
return new Promise((resolve, reject) => {
fetchMerchandiseNews(value, id) { //
return new Promise(async (resolve, reject) => {
//
let par = {
delFlag: 0,
@ -1121,14 +1121,19 @@
if (this.processUdgetPlanMaterialTable.columns[2].options.length > 0) {
this.processUdgetPlanMaterialTable.columns[2].options = []
}
this.$refs.processUdgetPlanMaterial.getValues((a, b, c) => {
b.forEach(item => {
await this.pastSla();
console.log("====",this.historyNumList.length)
if(this.historyNumList.length > 0){
this.historyNumList.forEach(item => {
if (!!item.materialNumber) {
numberList.push(item.materialNumber)
}
})
})
}
// this.$refs.processUdgetPlanMaterial.getValues((a, b, c) => {
//
//
// })
getAction(this.url.merchandiseNewsList, par).then((res) => {
// console.log('12312', res.result)
// console.log('12312')

Loading…
Cancel
Save