Browse Source

防止重复

dev
kilo 2 years ago
parent
commit
3f4b0f096e
  1. 54
      src/views/activiti/form/ProcessMaterialWarehousingForm.vue
  2. 54
      src/views/activiti/form/ProcessMaterialsAllotForm.vue
  3. 56
      src/views/activiti/form/ProcessMaterialsDeliveryForm.vue
  4. 46
      src/views/activiti/form/ProcessPermissionAuthorizationForm.vue
  5. 54
      src/views/activiti/form/ProcessSmaterialsScrapForm.vue
  6. 167
      src/views/activiti/form/ProcessUdgetPlanForm.vue

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

@ -504,19 +504,21 @@
formData.title = this.processData.title
formData.processInstanceId = this.processData.id
}
this.btndisabled = true
httpAction(url, formData, method).then((res) => {
if (res.success) {
this.$message.success('提交申请成功!')
//todo
this.$emit('loadData')
this.close()
} else {
this.$message.error(res.message)
}
}).finally(() => {
this.btndisabled = false
})
if(this.btndisabled === false){
this.btndisabled = true
httpAction(url, formData, method).then((res) => {
if (res.success) {
this.$message.success('提交申请成功!')
//todo
this.$emit('loadData')
this.close()
} else {
this.$message.error(res.message)
}
}).finally(() => {
this.btndisabled = false
})
}
}
})
})
@ -562,18 +564,20 @@
method = 'put'
}
console.log('格式化后的数据', formData)
this.btndisabled = true
httpAction(url, formData, method).then((res) => {
if (res.success) {
//this.$message.success('')
//todo
this.$emit('afterSubmit', formData)
} else {
this.$message.error(res.message)
}
}).finally(() => {
this.btndisabled = false
})
if(this.btndisabled === false){
this.btndisabled = true
httpAction(url, formData, method).then((res) => {
if (res.success) {
//this.$message.success('')
//todo
this.$emit('afterSubmit', formData)
} else {
this.$message.error(res.message)
}
}).finally(() => {
this.btndisabled = false
})
}
}
})
})

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

@ -811,19 +811,21 @@
}
}
console.log('提交方法', method)
this.btndisabled = true
httpAction(url, formData, method).then((res) => {
if (res.success) {
this.$message.success('提交申请成功!')
//todo
this.$emit('loadData')
this.close()
} else {
this.$message.error(res.message)
}
}).finally(() => {
this.btndisabled = false
})
if(this.btndisabled === false){
this.btndisabled = true
httpAction(url, formData, method).then((res) => {
if (res.success) {
this.$message.success('提交申请成功!')
//todo
this.$emit('loadData')
this.close()
} else {
this.$message.error(res.message)
}
}).finally(() => {
this.btndisabled = false
})
}
}
})
})
@ -870,18 +872,20 @@
method = 'put'
}
console.log('提交方法', method)
this.btndisabled = true
httpAction(url, formData, method).then((res) => {
if (res.success) {
this.$message.success('保存成功!')
//todo
this.$emit('afterSubmit', formData)
} else {
this.$message.error(res.message)
}
}).finally(() => {
this.btndisabled = false
})
if (this.btndisabled === false){
this.btndisabled = true
httpAction(url, formData, method).then((res) => {
if (res.success) {
this.$message.success('保存成功!')
//todo
this.$emit('afterSubmit', formData)
} else {
this.$message.error(res.message)
}
}).finally(() => {
this.btndisabled = false
})
}
}
})
})

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

@ -1312,7 +1312,7 @@
},
/*提交申请*/
applySubmit(e) {
this.getAllTable().then(tables => {
this.getAllTable().then(tables => {
return validateFormAndTables(this.form, tables)
}).then(allValues => {
@ -1364,19 +1364,21 @@
formData.processInstanceId = this.processData.id
}
console.log('提交方法', method)
this.btndisabled = true
httpAction(url, formData, method).then((res) => {
if (res.success) {
this.$message.success('提交申请成功!')
//todo
this.$emit('loadData')
this.close()
} else {
this.$message.error(res.message)
}
}).finally(() => {
this.btndisabled = false
})
if(this.btndisabled === false){
this.btndisabled = true
httpAction(url, formData, method).then((res) => {
if (res.success) {
this.$message.success('提交申请成功!')
//todo
this.$emit('loadData')
this.close()
} else {
this.$message.error(res.message)
}
}).finally(() => {
this.btndisabled = false
})
}
}
})
})
@ -1429,18 +1431,20 @@
method = 'put'
}
console.log('提交方法', method)
this.btndisabled = true
httpAction(url, formData, method).then((res) => {
if (res.success) {
//this.$message.success("")
//todo
this.$emit('afterSubmit', formData)
} else {
this.$message.error(res.message)
}
}).finally(() => {
this.btndisabled = false
})
if (this.btndisabled === false){
this.btndisabled = true
httpAction(url, formData, method).then((res) => {
if (res.success) {
//this.$message.success("")
//todo
this.$emit('afterSubmit', formData)
} else {
this.$message.error(res.message)
}
}).finally(() => {
this.btndisabled = false
})
}
}
})
})

46
src/views/activiti/form/ProcessPermissionAuthorizationForm.vue

@ -322,17 +322,19 @@
this.$message.error("授权开始时间不能大于授权结束时间")
return;
}
this.btndisabled = true;
httpAction(httpurl,formData,method).then((res)=>{
if(res.success){
this.$emit('loadData')
this.close();
}else{
that.$message.warning(res.message);
}
}).finally(() => {
this.btndisabled = false;
})
if(this.btndisabled === false){
this.btndisabled = true;
httpAction(httpurl,formData,method).then((res)=>{
if(res.success){
this.$emit('loadData')
this.close();
}else{
that.$message.warning(res.message);
}
}).finally(() => {
this.btndisabled = false;
})
}
}
})
@ -365,16 +367,18 @@
this.$message.error("授权开始时间不能大于授权结束时间")
return;
}
this.btndisabled = true;
httpAction(httpurl,formData,method).then((res)=>{
if(res.success){
this.$emit('afterSubmit',formData)
}else{
that.$message.warning(res.message);
}
}).finally(() => {
this.btndisabled = false;
})
if (this.btndisabled === false){
this.btndisabled = true;
httpAction(httpurl,formData,method).then((res)=>{
if(res.success){
this.$emit('afterSubmit',formData)
}else{
that.$message.warning(res.message);
}
}).finally(() => {
this.btndisabled = false;
})
}
}
})

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

@ -580,19 +580,21 @@
}
}
console.log('提交方法', method)
this.btndisabled = true
httpAction(url, formData, method).then((res) => {
if (res.success) {
this.$message.success('提交申请成功!')
//todo
this.$emit('loadData')
this.close();
} else {
this.$message.error(res.message)
}
}).finally(() => {
this.btndisabled = false
})
if(this.btndisabled === false){
this.btndisabled = true
httpAction(url, formData, method).then((res) => {
if (res.success) {
this.$message.success('提交申请成功!')
//todo
this.$emit('loadData')
this.close();
} else {
this.$message.error(res.message)
}
}).finally(() => {
this.btndisabled = false
})
}
}
})
})
@ -632,18 +634,20 @@
method = 'put'
}
console.log('提交方法', method)
this.btndisabled = true
httpAction(url, formData, method).then((res) => {
if (res.success) {
this.$message.success('保存成功!')
//todo
this.$emit('afterSubmit', formData)
} else {
this.$message.error(res.message)
}
}).finally(() => {
this.btndisabled = false
})
if(this.btndisabled === false){
this.btndisabled = true
httpAction(url, formData, method).then((res) => {
if (res.success) {
this.$message.success('保存成功!')
//todo
this.$emit('afterSubmit', formData)
} else {
this.$message.error(res.message)
}
}).finally(() => {
this.btndisabled = false
})
}
}
})
})

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

@ -98,7 +98,7 @@
:isabled="isabled"
:rowSelection="true"
:actionButton="true"
@shifu="shifu"
@shifu = "shifu"
@descriptionFetch="fetchMerchandiseNews"
>
<template v-slot:action="props">
@ -137,7 +137,7 @@
</a-form-item>
<a-form-item v-if="task" :wrapperCol="{ span: 24 }" style="text-align: center">
<a-button type="primary" @click="passTask">通过</a-button>
<!-- <a-button type="primary" @click="ewrold">下载</a-button>-->
<!-- <a-button type="primary" @click="ewrold">下载</a-button>-->
<a-button style="margin-left: 8px" @click="backTask">驳回</a-button>
</a-form-item>
</div>
@ -502,16 +502,15 @@
materialType: { rules: [{ required: true, message: '请选择物资类型!' }] },
needTime: { rules: [{ required: true, message: '请选择需求时间!' }] },
processPlan: { rules: [{ required: true, message: '请选择流程计划!' }] },
sort: {
rules: [{ required: true, type: 'number', max: 999999999999, message: '请输入序号!(0 ~ 12个字符)' }
// { type:'number', max:999999999999, message: ' 0 12 '}
// {validator: this.lengthCheck}
]
sort: { rules: [{ required: true, type:'number', max:999999999999, message: '请输入序号!(0 ~ 12个字符)'},
// { type:'number', max:999999999999, message: ' 0 12 '}
// {validator: this.lengthCheck}
]
}
},
isBu: undefined,
planType: '',
isShifu: false
isShifu:false
}
},
props: {
@ -585,7 +584,7 @@
immediate: true,
handler: function(val) {
this.planType = val
console.log('this.planType---', this.planType)
console.log("this.planType---",this.planType)
}
}
},
@ -599,7 +598,7 @@
// userInfo.company=company;
if (!this.isNew) {
this.init()
} else {
}else {
this.popupCallback(company, userInfo)
}
// this.descriptionFetchDatas();
@ -610,18 +609,18 @@
// this.form.setFieldsValue("materialGroup",123123);
},
methods: {
lengthCheck(rule, value, callback) {
if (value.toString().length >= 12) {
lengthCheck(rule, value, callback){
if (value.toString().length >= 12 ){
// console.log("");
callback('长度应当在0 ~ 12 字符')
callback("长度应当在0 ~ 12 字符")
}
},
selectRowChange(a, b, c) {
// console.log("",a,b,c);
},
shifu() {
console.log('执行了')
this.isShifu = true
shifu(){
console.log("执行了");
this.isShifu = true;
},
// handleChange(value, key, column) {
@ -670,7 +669,7 @@
this.hiegs = false
// this.fetchData();
// this.fetchDataRake()
this.fetchMerchandiseNews()
this.fetchMerchandiseNews();
}
},
//
@ -767,8 +766,8 @@
}
},
//table
async onSelect(record) {
//table
async onSelect (record) {
let isEr = true
// if (!!record.row.materialGroup) {
@ -800,22 +799,22 @@
// }
// console.log("5555",record.row);
// if ( !!record.row.materialNumber && isEr) {
let b = false
if (this.isShifu) {
let b = false;
if(this.isShifu){
// console.log("0",record);
for (const res of this.bigIdMerchandiseNewsList) {
if (res.id === record.row.materialNumber) {
b = true
if(res.id === record.row.materialNumber ){
b = true;
}
}
if (!b) {
if(!b){
// console.log("111");
await this.fetchMerchandiseNews(null, record.row.materialNumber)
await this.fetchMerchandiseNews(null,record.row.materialNumber );
}
}
this.isShifu = false
if (record.column.key !== 'materialPrice' && record.column.key !== 'materialQuantity') {
if (!!record.row.materialNumber && this.isBu !== record.row.materialNumber) {
this.isShifu = false;
if(record.column.key !== 'materialPrice' && record.column.key !== 'materialQuantity'){
if ( !!record.row.materialNumber && this.isBu !== record.row.materialNumber ) {
// console.log("2");
let materialName = {}
this.bigIdMerchandiseNewsList.forEach(item => {
@ -831,7 +830,7 @@
}
})
if (!!record.row.id && Object.keys(materialName).length > 0) {
if (!!record.row.id && Object.keys(materialName).length > 0 ) {
await this.$refs.processUdgetPlanMaterial.getValues((a, b, c) => {
// console.log("bbbbbbbbbbbbbb",b)
b.forEach(item => {
@ -853,13 +852,14 @@
]
// console.log("sadf1111")
this.$refs.processUdgetPlanMaterial.setValues(values)
return
return ;
}
})
})
this.processUdgetPlanMaterialTable.columns[0].options.push({
title: materialName.materialClassify,
value: materialName.descriptionId
@ -879,13 +879,15 @@
}
]
this.$refs.processUdgetPlanMaterial.setValues(values)
this.isBu = record.row.materialNumber
this.isBu = record.row.materialNumber;
isEr = false
}
}
}
if (!!record.row.materialQuantity && !!record.row.materialPrice && isEr) {
if (!!record.row.materialQuantity && !!record.row.materialPrice && isEr ) {
// record.row.materialAmount = record.row.materialQuantity * record.row.materialPrice;
// console.log("3");
//5
@ -915,13 +917,13 @@
}
},
fetchMerchandiseNews(value, id) { //
return new Promise((resolve, reject) => {
fetchMerchandiseNews(value,id) { //
return new Promise((resolve, reject)=>{
//
let par = {
delFlag: 0,
descriptionId: value,
id: id
id:id
}
this.bigIdMerchandiseNews = []
this.bigIdMerchandiseNewsList = []
@ -930,14 +932,14 @@
if (this.processUdgetPlanMaterialTable.columns[1].options.length > 0) {
this.processUdgetPlanMaterialTable.columns[1].options = []
}
this.$refs.processUdgetPlanMaterial.getValues((a, b, c) => {
b.forEach(item => {
if (item.materialNumber !== '' && item.materialNumber !== undefined && item.materialNumber !== null) {
numberList.push(item.materialNumber)
}
})
this.$refs.processUdgetPlanMaterial.getValues((a, b, c) => {
b.forEach(item => {
if (item.materialNumber !== '' && item.materialNumber !== undefined && item.materialNumber !== null) {
numberList.push(item.materialNumber)
}
})
})
})
getAction(this.url.merchandiseNewsList, par).then((res) => {
// console.log('12312', res.result)
// console.log('12312')
@ -972,12 +974,12 @@
})
})
}
this.bigIdMerchandiseNewsList = res.result
this.bigIdMerchandiseNewsList = res.result;
// resolve( this.bigIdMerchandiseNewsList );
}
resolve(this.bigIdMerchandiseNewsList)
resolve( this.bigIdMerchandiseNewsList );
})
})
});
},
// fetchMerchandiseNews(value){ //
@ -1076,8 +1078,8 @@
id: r.tableId
}).then((res) => {
if (res.success) {
console.log('res.result.planType--', res.result.planType)
this.$emit('planType', res.result.planType)
console.log("res.result.planType--",res.result.planType)
this.$emit('planType',res.result.planType)
this.planType = res.result.planType
let formData = res.result
formData.tableName = r.tableName
@ -1162,8 +1164,8 @@
formData.procDefId = this.processData.id
formData.procDeTitle = this.processData.name
formData.title = this.processData.description
formData.planType = this.planType
console.log('this.planType++', this.planType)
formData.planType=this.planType;
console.log("this.planType++",this.planType)
if (!formData.tableName) formData.tableName = this.processData.businessTable
var url = this.url.addFromTableApply
let method = 'post'
@ -1177,20 +1179,22 @@
formData.title = this.processData.title
formData.processInstanceId = this.processData.id
}
this.btndisabled = true
console.log(formData, '表单数据')
httpAction(url, formData, method).then((res) => {
if (res.success) {
this.$message.success('提交申请成功!')
//todo
this.$emit('loadData')
this.close()
} else {
this.$message.error(res.message)
}
}).finally(() => {
this.btndisabled = false
})
if(this.btndisabled === false){
this.btndisabled = true
httpAction(url,formData,method).then((res)=>{
if (res.success){
this.$message.success("提交申请成功!")
//todo
this.$emit('loadData')
this.close();
}else {
this.$message.error(res.message)
}
}).finally(()=>{
this.btndisabled = false;
})
}
}
})
})
@ -1215,7 +1219,7 @@
}
console.log(this.data, '数据回显')
let fieldval = pick(this.data, 'id', 'planType', 'company', 'createTime', 'departId', 'createBy', 'materialType', 'processPlan', 'needTime', 'sort', 'orderNumber', 'fileId', 'opinion')
let fieldval = pick(this.data, 'id','planType', 'company', 'createTime', 'departId', 'createBy', 'materialType', 'processPlan', 'needTime','sort', 'orderNumber', 'fileId', 'opinion')
this.$nextTick(() => {
this.form.setFieldsValue(fieldval)
})
@ -1228,13 +1232,13 @@
}
},
descriptionId(val) {
descriptionId(val){
let pam = {
id: val
}
getAction(this.url.descriptionRakeUrlId, pam).then(res => {
getAction(this.url.descriptionRakeUrlId,pam).then(res =>{
if (res.success) {
if(res.success){
this.processUdgetPlanMaterialTable.columns[0].options.push({
title: res.result.materialClassify,
value: res.result.id
@ -1265,7 +1269,8 @@
for (let i = 0; i < this.listId.length; i++) {
// console.log(this.listId[i])\
this.descriptionId(this.listId[i])
this.descriptionId(this.listId[i]);
this.fetchMerchandiseNews(this.listId[i])
}
@ -1347,7 +1352,7 @@
formData.procDefId = this.processData.id
formData.procDeTitle = this.processData.name
formData.title = this.processData.description
formData.planType = this.planType
formData.planType=this.planType;
if (!formData.tableName) formData.tableName = this.processData.businessTable
var url = this.url.add
let method = 'post'
@ -1355,19 +1360,21 @@
url = this.url.edit
method = 'put'
}
this.btndisabled = true
console.log(formData, '格式化的数据')
httpAction(url, formData, method).then((res) => {
if (res.success) {
//this.$message.success("")
//todo
this.$emit('afterSubmit', formData)
} else {
this.$message.error(res.message)
}
}).finally(() => {
this.btndisabled = false
})
if(this.btndisabled === false){
this.btndisabled = true
httpAction(url,formData,method).then((res)=>{
if (res.success){
//this.$message.success("")
//todo
this.$emit('afterSubmit',formData)
}else {
this.$message.error(res.message)
}
}).finally(()=>{
this.btndisabled = false;
})
}
}
})
})

Loading…
Cancel
Save