From 747c7b743246f883e91a8de9e542378bd5cc62b4 Mon Sep 17 00:00:00 2001 From: long <18782126717@163.com> Date: Thu, 1 Dec 2022 14:49:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=AA=E6=98=AF=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E5=88=A4=E6=96=AD=EF=BC=8C=E4=BF=AE=E6=94=B9=E6=9D=83?= =?UTF-8?q?=E9=99=90=E6=B5=81=E7=A8=8B=E6=B7=BB=E5=8A=A0=E4=BF=AE=E6=94=B9?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProcessMaterialWarehousingStatement.vue | 4 +- .../ProcessMaterialsPlanStatement.vue | 5 +- .../ProcessMaterialsPlanStatement2.vue | 4 +- .../form/ProcessPermissionAuthorization.vue | 1 - .../ProcessPermissionAuthorizationForm.vue | 134 ++++++++---------- 5 files changed, 63 insertions(+), 85 deletions(-) diff --git a/src/views/accessrecords/statement/ProcessMaterialWarehousingStatement.vue b/src/views/accessrecords/statement/ProcessMaterialWarehousingStatement.vue index d5ea063..732150c 100644 --- a/src/views/accessrecords/statement/ProcessMaterialWarehousingStatement.vue +++ b/src/views/accessrecords/statement/ProcessMaterialWarehousingStatement.vue @@ -99,7 +99,7 @@ // 下载 downWord() { downFile(this.url.queryPlandDownWord, { id: this.queryParam.id }).then((data) => { - if (!data) { + if (!data.size>0) { this.$message.warning("文件下载失败") return } @@ -116,7 +116,7 @@ }, previewWord() { downFile(this.url.queryPlanPrevie, { id: this.queryParam.id }).then((data) => { - if (!data) { + if (!data.size>0) { this.$message.warning("文件预览失败") return } diff --git a/src/views/accessrecords/statement/ProcessMaterialsPlanStatement.vue b/src/views/accessrecords/statement/ProcessMaterialsPlanStatement.vue index 9802f7d..42b43d7 100644 --- a/src/views/accessrecords/statement/ProcessMaterialsPlanStatement.vue +++ b/src/views/accessrecords/statement/ProcessMaterialsPlanStatement.vue @@ -97,7 +97,7 @@ // 下载 downWord() { downFile(this.url.queryPlandDownWord, { id: this.queryParam.id }).then((data) => { - if (!data) { + if (!data.size>0) { this.$message.warning("文件下载失败") return } @@ -114,14 +114,13 @@ }, previewWord() { downFile(this.url.queryPlanPrevie, { id: this.queryParam.id }).then((data) => { - if (!data) { + if (!data.size>0) { this.$message.warning("文件预览失败") return } console.log(data) const blob = new Blob([data], { type: 'application/pdf' }) this.pdfSrc = window.URL.createObjectURL(blob) - console.log(this.pdfSrc) window.open(this.pdfSrc)//新窗口打开,借用浏览器去打印 }) }, diff --git a/src/views/accessrecords/statement/ProcessMaterialsPlanStatement2.vue b/src/views/accessrecords/statement/ProcessMaterialsPlanStatement2.vue index 6f2d834..247ad78 100644 --- a/src/views/accessrecords/statement/ProcessMaterialsPlanStatement2.vue +++ b/src/views/accessrecords/statement/ProcessMaterialsPlanStatement2.vue @@ -99,7 +99,7 @@ // 下载 downWord() { downFile(this.url.queryPlandDownWord, { id: this.queryParam.id }).then((data) => { - if (!data) { + if (!data.size>0) { this.$message.warning("文件下载失败") return } @@ -116,7 +116,7 @@ }, previewWord() { downFile(this.url.queryPlanPrevie, { id: this.queryParam.id }).then((data) => { - if (!data) { + if (!data.size>0) { this.$message.warning("文件预览失败") return } diff --git a/src/views/activiti/form/ProcessPermissionAuthorization.vue b/src/views/activiti/form/ProcessPermissionAuthorization.vue index ab9678a..42ae994 100644 --- a/src/views/activiti/form/ProcessPermissionAuthorization.vue +++ b/src/views/activiti/form/ProcessPermissionAuthorization.vue @@ -28,7 +28,6 @@ components: { ProcessPermissionAuthorizationForm, historicPictrue, historicDetail }, data() { return { - isNew: '' } }, props: { diff --git a/src/views/activiti/form/ProcessPermissionAuthorizationForm.vue b/src/views/activiti/form/ProcessPermissionAuthorizationForm.vue index d4f73b5..68da35a 100644 --- a/src/views/activiti/form/ProcessPermissionAuthorizationForm.vue +++ b/src/views/activiti/form/ProcessPermissionAuthorizationForm.vue @@ -218,6 +218,7 @@ let company = sessionStorage.getItem("PARENT_ID"); let userInfo=sessionStorage.getItem("USER_INFORMATION"); + console.log(this.isNew,"++++++++++++++++++") if (!this.isNew){ this.init(); }else { @@ -240,7 +241,7 @@ let formData = res.result; formData.tableName = r.tableName; this.data = formData; - console.log("表单回显数据",this.data) + console.log("表单回显数据-----------",this.data) this.editAfter(); this.btndisabled = false; }else { @@ -251,7 +252,7 @@ add () { this.edit({}); }, - edit (record) { + editAfter (record) { this.form.resetFields(); this.model = Object.assign({}, record); this.visible = true; @@ -260,8 +261,9 @@ this.data = getRecord(this.data) } + console.log(this.data,"89898989") this.$nextTick(() => { - this.form.setFieldsValue(pick(this.data,'company','createTime','departId','createBy','authorizationPerson','authorizedPerson','privilegedTimeStart','privilegedTimeEnd','continueAuthorize','privilegedAffirmedTime','authorizationNumberDays','fileId','opinion')) + this.form.setFieldsValue(pick(this.data,'id','company','createTime','departId','createBy','authorizationPerson','authorizedPerson','privilegedTimeStart','privilegedTimeEnd','continueAuthorize','privilegedAffirmedTime','authorizationNumberDays','fileId','opinion')) }) }, close() { @@ -289,74 +291,51 @@ }, /*提交申请*/ applySubmit(e) { - this.getAllTable().then(tables => { - return validateFormAndTables(this.form, tables) - }).then(allValues=>{ - if (typeof this.classifyIntoFormData !== 'function') { - throw this.throwNotFunction('classifyIntoFormData') - } - let formData = this.classifyIntoFormData(allValues) - //计算总价 - for (let i = 0; i < formData.processUdgetPlanMaterialList.length; i++) { - this.materialAmount=this.materialAmount+ formData.processUdgetPlanMaterialList[i].materialAmount; - if (i==0){ - this.describes=formData.processUdgetPlanMaterialList[i].materialName - }else { - this.describes=this.describes+"---"+formData.processUdgetPlanMaterialList[i].materialName + const that = this; + // 触发表单验证 + this.form.validateFields((err, values) => { + if (!err) { + let httpurl = ''; + let method = ''; + let formData = Object.assign(this.model, values); + formData.procDefId = this.processData.id; + formData.procDeTitle = this.processData.name; + formData.title=this.processData.description; + formData.fileId = getStringArry(formData.fileId) + if (!formData.tableName)formData.tableName = this.processData.businessTable; + if(!formData.id){ + httpurl+=this.url.addAuthorizationApply; + method = 'post'; + }else{ + httpurl+=this.url.editAuthorizationApply; + 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 } - - } - formData.fileId = getStringArry(formData.fileId) - formData.materialPrice=this.materialPrice; - formData.materialAmount=this.materialAmount; - formData.describes=this.describes; - if (new Date(formData.createTime).getTime()/100>new Date(formData.needTime).getTime()/100){ - this.$message.error("需求时间不能小于当前流程发起时间") - return; + console.log('格式化后的数据---',method) + console.log("表单提交数据",formData) + if (new Date(formData.privilegedTimeStart).getTime()/100>=new Date(formData.privilegedTimeEnd).getTime()/100){ + 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; + }) } - console.log(this.materialAmount,'采购总价') - console.log(this.opinion,'流程说明') - this.form.validateFields((err, values) => { - if (!err) { - formData.procDefId = this.processData.id; - formData.procDeTitle = this.processData.name; - formData.title=this.processData.description; - if (!formData.tableName)formData.tableName = this.processData.businessTable; - var url = this.url.addAuthorizationApply; - let method='post'; - if (!this.isNew){ - url = this.url.editAuthorizationApply; - 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; - } - } - 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; - }) - } - }) }) - }, handleSubmit () { const that = this; @@ -365,20 +344,22 @@ if (!err) { let httpurl = ''; let method = ''; - if(!this.model.id){ - httpurl+=this.url.add; - method = 'post'; - }else{ - httpurl+=this.url.edit; - method = 'put'; - } + + let formData = Object.assign(this.model, values); formData.procDefId = this.processData.id; formData.procDeTitle = this.processData.name; formData.title=this.processData.description; formData.fileId = getStringArry(formData.fileId) if (!formData.tableName)formData.tableName = this.processData.businessTable; - console.log('格式化后的数据',formData) + if(!formData.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + httpurl+=this.url.edit; + method = 'put'; + } + console.log('格式化后的数据---',method) console.log("表单提交数据",formData) if (new Date(formData.privilegedTimeStart).getTime()/100>=new Date(formData.privilegedTimeEnd).getTime()/100){ this.$message.error("授权开始时间不能大于授权结束时间") @@ -387,8 +368,7 @@ this.btndisabled = true; httpAction(httpurl,formData,method).then((res)=>{ if(res.success){ - that.$message.success(res.message); - that.$emit('afterSubmit',formData); + this.$emit('afterSubmit',formData) }else{ that.$message.warning(res.message); }