From 36c82f723a68971af8f7faa7e25c1b7bfd32eed5 Mon Sep 17 00:00:00 2001 From: yunuo970428 <405378304@qq.com> Date: Mon, 2 Sep 2024 11:17:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=B8=93=E9=A1=B9=E8=BF=94?= =?UTF-8?q?=E5=88=A9=E5=88=86=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../specialrebatedistributionAdd.vue | 67 +++++++++--------- .../specialrebatedistributionInfo.vue | 4 +- .../specialrebatetobeallocatedAdd.vue | 10 +-- .../zhuanxiangfanlifenpeiDaiBanInfo.vue | 4 +- .../zhuanxiangfanlifenpeiEdit.vue | 69 +++++++++---------- .../zhuanxiangfanlifenpeiYiBanInfo.vue | 4 +- 6 files changed, 75 insertions(+), 83 deletions(-) diff --git a/anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatedistribution/specialrebatedistributionAdd.vue b/anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatedistribution/specialrebatedistributionAdd.vue index d229426304..4a3d2e6aa7 100644 --- a/anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatedistribution/specialrebatedistributionAdd.vue +++ b/anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatedistribution/specialrebatedistributionAdd.vue @@ -173,8 +173,10 @@ export default { this.viewTitle = '【编辑】专项返利分配申请' console.log('编辑回显', row.sid) req.fetchDetailsBySid(row.sid).then((resp) => { - this.formobj = resp.data - this.formobj.instanceId = resp.data.procInstId + if (resp.success) { + this.formobj = resp.data + this.formobj.instanceId = resp.data.procInstId + } }).catch((e) => { this.formobj = row }) @@ -233,36 +235,31 @@ export default { estimateRebate: e.estimateRebate, uploadMoney: e.uploadMoney, disNum: e.disNum, - unitSetAllocationMoney: (parseInt(e.uploadMoney)) / (parseInt(e.disNum)) + unitSetAllocationMoney: Math.round((parseFloat(e.uploadMoney) / parseFloat(e.disNum)) * 100) / 100 }) }) } }, changeBrand(value) { - let bb = null - this.brand_list.forEach((e) => { - if (e.brandName === value) { - bb = { - name: e.brandName, - sid: e.sid - } - } - }) - this.formobj.brandSid = bb.sid + const choose = this.brand_list.filter((item) => item.brandName === value) + if (choose !== null && choose.length > 0) { + this.formobj.brandSid = choose[0].sid + } else { + this.formobj.brandSid = '' + } }, saveOrUpdate() { - console.log(this.formobj) this.$refs['form_obj'].validate((valid) => { if (valid) { + if (this.formobj.scmSpecialrebatedistributedetails.length === 0) { + this.$message({ showClose: true, type: 'error', message: '专项返利分配申请列表不能为空' }) + return + } this.submitdisabled = true req.saveOrUpdate(this.formobj).then((resp) => { this.submitdisabled = false if (resp.success) { - this.$message({ - showClose: true, - type: 'success', - message: resp.msg - }) + this.$message({ showClose: true, type: 'success', message: resp.msg }) this.handleReturn('true') } }).catch(() => { @@ -274,24 +271,24 @@ export default { }) }, submitVehicleApply() { - if (this.formobj.scmSpecialrebatedistributedetails.length === 0) { - this.$message({ showClose: true, type: 'error', message: '专项返利分配申请列表不能为空' }) - return - } - req.submitVehicleApply(this.formobj).then((res) => { - if (res.success) { - this.$message({ - showClose: true, - type: 'success', - message: '提交成功' + this.$refs['form_obj'].validate((valid) => { + if (valid) { + if (this.formobj.scmSpecialrebatedistributedetails.length === 0) { + this.$message({ showClose: true, type: 'error', message: '专项返利分配申请列表不能为空' }) + return + } + this.submitdisabled = true + req.submitVehicleApply(this.formobj).then((resp) => { + this.submitdisabled = false + if (resp.success) { + this.$message({ showClose: true, type: 'success', message: resp.msg }) + this.handleReturn('true') + } + }).catch(() => { + this.submitdisabled = false }) - this.handleReturn('true') } else { - this.$message({ - showClose: true, - type: 'error', - message: '提交失败' - }) + return false } }) }, diff --git a/anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatedistribution/specialrebatedistributionInfo.vue b/anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatedistribution/specialrebatedistributionInfo.vue index f66bbb074f..db85498ed3 100644 --- a/anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatedistribution/specialrebatedistributionInfo.vue +++ b/anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatedistribution/specialrebatedistributionInfo.vue @@ -100,7 +100,9 @@ export default { this.viewTitle = '专项返利分配申请详情' console.log('编辑回显', row.sid) req.fetchDetailsBySid(row.sid).then((resp) => { - this.formobj = resp.data + if (resp.success) { + this.formobj = resp.data + } }).catch((e) => { this.formobj = row }) diff --git a/anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatedistribution/specialrebatetobeallocatedAdd.vue b/anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatedistribution/specialrebatetobeallocatedAdd.vue index 0cf5e4d88e..9093af4c5e 100644 --- a/anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatedistribution/specialrebatetobeallocatedAdd.vue +++ b/anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatedistribution/specialrebatetobeallocatedAdd.vue @@ -104,7 +104,7 @@ import req from '@/api/specialrebate/specialrebatedistribution' import selectvehicle from './relation/selectvehicle.vue' export default { - name: 'specialrebatetobeallocatedAdd', + name: 'SpecialrebatetobeallocatedAdd', components: { selectvehicle }, @@ -162,7 +162,7 @@ export default { this.viewState = 1 if (value.length > 0) { this.formobj.setNumber = value.length - this.formobj.unitSetAllocationMoney = (parseInt(this.formobj.allocationMoney)) / (parseInt(this.formobj.setNumber)) + this.formobj.unitSetAllocationMoney = Math.round((parseFloat(this.formobj.allocationMoney) / parseFloat(this.formobj.setNumber)) * 100) / 100 value.forEach((e) => { this.formobj.scmSpecialrebateVehsVehSidAndVinNos.push({ modelName: e.modelName, @@ -184,11 +184,7 @@ export default { req.save(this.formobj).then((resp) => { this.submitdisabled = false if (resp.success) { - this.$message({ - showClose: true, - type: 'success', - message: resp.msg - }) + this.$message({ showClose: true, type: 'success', message: resp.msg }) this.handleReturn('true') } }).catch(() => { diff --git a/anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanlifenpeiFlow/zhuanxiangfanlifenpeiDaiBanInfo.vue b/anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanlifenpeiFlow/zhuanxiangfanlifenpeiDaiBanInfo.vue index 5d8b9449d2..3d1466c49b 100644 --- a/anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanlifenpeiFlow/zhuanxiangfanlifenpeiDaiBanInfo.vue +++ b/anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanlifenpeiFlow/zhuanxiangfanlifenpeiDaiBanInfo.vue @@ -173,7 +173,9 @@ export default { this.viewTitle = '专项返利分配申请详情' console.log('编辑回显', sid) req.fetchDetailsBySid(sid).then((resp) => { - this.formobj = resp.data + if (resp.success) { + this.formobj = resp.data + } }).catch((e) => { this.formobj = {} }) diff --git a/anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanlifenpeiFlow/zhuanxiangfanlifenpeiEdit.vue b/anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanlifenpeiFlow/zhuanxiangfanlifenpeiEdit.vue index 3e5538ed96..081584e1da 100644 --- a/anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanlifenpeiFlow/zhuanxiangfanlifenpeiEdit.vue +++ b/anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanlifenpeiFlow/zhuanxiangfanlifenpeiEdit.vue @@ -153,8 +153,10 @@ export default { this.viewTitle = '【编辑】专项返利分配申请' console.log('编辑回显', sid) req.fetchDetailsBySid(sid).then((resp) => { - this.formobj = resp.data - this.formobj.instanceId = resp.data.procInstId + if (resp.success) { + this.formobj = resp.data + this.formobj.instanceId = resp.data.procInstId + } }).catch((e) => { this.formobj = {} }) @@ -213,36 +215,27 @@ export default { estimateRebate: e.estimateRebate, uploadMoney: e.uploadMoney, disNum: e.disNum, - unitSetAllocationMoney: (parseInt(e.uploadMoney)) / (parseInt(e.disNum)) + unitSetAllocationMoney: Math.round((parseInt(e.uploadMoney) / parseInt(e.disNum)) * 100) / 100 }) }) } }, changeBrand(value) { - let bb = null - this.brand_list.forEach((e) => { - if (e.brandName === value) { - bb = { - name: e.brandName, - sid: e.sid - } - } - }) - this.formobj.brandSid = bb.sid + const choose = this.brand_list.filter((item) => item.brandName === value) + if (choose !== null && choose.length > 0) { + this.formobj.brandSid = choose[0].sid + } else { + this.formobj.brandSid = '' + } }, saveOrUpdate() { - console.log(this.formobj) this.$refs['form_obj'].validate((valid) => { if (valid) { this.submitdisabled = true req.saveOrUpdate(this.formobj).then((resp) => { this.submitdisabled = false if (resp.success) { - this.$message({ - showClose: true, - type: 'success', - message: resp.msg - }) + this.$message({ showClose: true, type: 'success', message: resp.msg }) // 子页面向父级页面传递值(关闭弹框) window.parent.postMessage({ cmd: 'returnHeight', @@ -261,27 +254,27 @@ export default { }) }, submitVehicleApply() { - req.submitVehicleApply(this.formobj).then((res) => { - if (res.success) { - this.$message({ - showClose: true, - type: 'success', - message: '提交成功' - }) - // 子页面向父级页面传递值(关闭弹框) - window.parent.postMessage({ - cmd: 'returnHeight', - params: { - // 操作成功,告诉父级页面关闭弹框 - code: 1 + this.$refs['form_obj'].validate((valid) => { + if (valid) { + this.submitdisabled = true + req.submitVehicleApply(this.formobj).then((resp) => { + this.submitdisabled = false + if (resp.success) { + this.$message({ showClose: true, type: 'success', message: resp.msg }) + // 子页面向父级页面传递值(关闭弹框) + window.parent.postMessage({ + cmd: 'returnHeight', + params: { + // 操作成功,告诉父级页面关闭弹框 + code: 1 + } + }, '*') } - }, '*') - } else { - this.$message({ - showClose: true, - type: 'error', - message: '提交失败' + }).catch(() => { + this.submitdisabled = false }) + } else { + return false } }) }, diff --git a/anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanlifenpeiFlow/zhuanxiangfanlifenpeiYiBanInfo.vue b/anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanlifenpeiFlow/zhuanxiangfanlifenpeiYiBanInfo.vue index 102d930a20..d1fefaae00 100644 --- a/anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanlifenpeiFlow/zhuanxiangfanlifenpeiYiBanInfo.vue +++ b/anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanlifenpeiFlow/zhuanxiangfanlifenpeiYiBanInfo.vue @@ -136,7 +136,9 @@ export default { this.viewTitle = '专项返利分配申请详情' console.log('编辑回显', sid) req.fetchDetailsBySid(sid).then((resp) => { - this.formobj = resp.data + if (resp.success) { + this.formobj = resp.data + } }).catch((e) => { this.formobj = {} })