From 2c7e66c9fbbbf99f2b45fdb061dd44a8bd600ccb Mon Sep 17 00:00:00 2001 From: zmj <1493694146@qq.com> Date: Fri, 15 Mar 2024 15:18:37 +0800 Subject: [PATCH] add --- src/views/customer_demand/edit.vue | 11 +--- src/views/customer_demand_solution/edit.vue | 10 ---- src/views/data_reception/edit.vue | 2 - src/views/project/edit.vue | 10 ---- src/views/project_commission/edit.vue | 54 +++++++++++++------ src/views/project_commission_detail/edit.vue | 6 +++ src/views/project_follow_up/edit.vue | 9 ---- src/views/project_salary_payment/edit.vue | 13 +---- .../task_handling_three_level_review/edit.vue | 6 +-- 9 files changed, 49 insertions(+), 72 deletions(-) diff --git a/src/views/customer_demand/edit.vue b/src/views/customer_demand/edit.vue index 109cbb3..a0776f7 100644 --- a/src/views/customer_demand/edit.vue +++ b/src/views/customer_demand/edit.vue @@ -57,7 +57,6 @@ - @@ -75,14 +74,8 @@ import { getAll } from '@/api/org/organization' import projectTable from "@/components/project/index.vue" import { apiCustomerDemandAdd, apiCustomerDemandEdit, apiCustomerDemandDetail } from '@/api/customer_demand' import { useDictData } from '@/hooks/useDictOptions' -// 上传文件 -import annexUpload from "@/components/annexUpload/index.vue" -const handleAvatarSuccess_four = (response: any) => { - // @ts-ignore - response.code != 0 ? formData.annex.push({ uri: response.data.uri, name: response.data.name }) : ElMessage.error(response.msg); -}; -// 删除上传的文件 -const delFileFn = (index: number) => { formData.annex.splice(index, 1) } + + let props = defineProps({ project: Object diff --git a/src/views/customer_demand_solution/edit.vue b/src/views/customer_demand_solution/edit.vue index b64017c..166c7f6 100644 --- a/src/views/customer_demand_solution/edit.vue +++ b/src/views/customer_demand_solution/edit.vue @@ -77,16 +77,6 @@ import { apiCustomerDemandSolutionAdd, apiCustomerDemandSolutionEdit, apiCustome import { timeFormat } from '@/utils/util' import type { PropType } from 'vue' - -// 上传文件 -import annexUpload from "@/components/annexUpload/index.vue" -const handleAvatarSuccess_four = (response: any) => { - formData.annex ||= [] - // @ts-ignore - response.code != 0 ? formData.annex.push({ uri: response.data.uri, name: response.data.name }) : ElMessage.error(response.msg); -}; -// 删除上传的文件 -const delFileFn = (index: number) => { formData.annex.splice(index, 1) } // 表单数据 const formData = reactive({ id: '', diff --git a/src/views/data_reception/edit.vue b/src/views/data_reception/edit.vue index 14a8250..d3c798b 100644 --- a/src/views/data_reception/edit.vue +++ b/src/views/data_reception/edit.vue @@ -81,7 +81,6 @@ - @@ -94,7 +93,6 @@ - diff --git a/src/views/project/edit.vue b/src/views/project/edit.vue index c8fa2ce..523a4e0 100644 --- a/src/views/project/edit.vue +++ b/src/views/project/edit.vue @@ -229,7 +229,6 @@ - @@ -249,15 +248,6 @@ import Popup from '@/components/popup/index.vue' import { apiProjectAdd, apiProjectEdit, apiProjectDetail } from '@/api/project' import { getAllProjectTypes } from '@/api/projecttype' import type { PropType } from 'vue' -// 上传文件 -import annexUpload from "@/components/annexUpload/index.vue" -const handleAvatarSuccess_four = (response: any) => { - formData.annex ||= [] - // @ts-ignore - response.code != 0 ? formData.annex.push({ uri: response.data.uri, name: response.data.name }) : ElMessage.error(response.msg); -}; -// 删除上传的文件 -const delFileFn = (index: number) => { formData.annex.splice(index, 1) } diff --git a/src/views/project_commission/edit.vue b/src/views/project_commission/edit.vue index f27decc..fe10721 100644 --- a/src/views/project_commission/edit.vue +++ b/src/views/project_commission/edit.vue @@ -2,7 +2,7 @@
- + @@ -43,17 +43,17 @@ - + - + - + @@ -65,7 +65,7 @@ - + @@ -128,7 +128,6 @@ - @@ -140,7 +139,6 @@ :value="item.value" /> - @@ -169,13 +167,13 @@ - @@ -196,6 +194,7 @@ import Popup from '@/components/popup/index.vue' import { apiProjectCommissionAdd, apiProjectCommissionEdit, } from '@/api/project_commission' import type { PropType } from 'vue' import { cost_project } from "@/components/dialogTable/dialogTableConfig" +import { watch } from "vue" defineProps({ dictData: { @@ -262,6 +261,9 @@ const customEvent = (e) => { formData.head = e.principal formData.affcontract = e.contract.id formData.affcontract_name = e.contract.contract_name + formData.industry = e.industry + // formData.hk=e. + // formData.hk=e. showDialog.value = false } @@ -290,6 +292,30 @@ const handleDelete = (row: any) => { formData.project_commission_detail.splice(index, 1); } + +// 金额计算 +watch(formData.project_commission_detail, (newVal, oldVal) => { + formData.project_commission_detail.forEach(item => { + item.tc_amount = (Number(item.sk_amount || 0) + Number(item.other_fee || 0)) * (item.tc_rate / 100) + item.tc_amount = item.tc_amount.toFixed(2) + }) +}) + + +// 计算本次支付金额 +const getBczfze = () => { + formData.bczfze = 0 + formData.project_commission_detail.forEach(item => { + formData.bczfze += Number(item.pay_amount) + }) +} + + +formData.ticheng ||= computed(() => { + return Number(formData.hk) * (Number(formData.rate) / 100) || 0 +}) + + const tableIndex = ref(0) const tableKey = ref('') //打开弹窗 @@ -317,6 +343,7 @@ const formRules = reactive({ // 获取详情 const setFormData = async (data: Record) => { + delete data.ticheng for (const key in formData) { if (data[key] != null && data[key] != undefined) { //@ts-ignore @@ -332,12 +359,6 @@ const setFormData = async (data: Record) => { } -const getDetail = async (row: Record) => { - const data = await apiProjectCommissionDetail({ - id: row.id - }) - setFormData(data) -} // 提交按钮 @@ -367,6 +388,5 @@ const handleClose = () => { defineExpose({ open, setFormData, - getDetail }) diff --git a/src/views/project_commission_detail/edit.vue b/src/views/project_commission_detail/edit.vue index 28d85e3..617730b 100644 --- a/src/views/project_commission_detail/edit.vue +++ b/src/views/project_commission_detail/edit.vue @@ -96,6 +96,11 @@ const formData = reactive({ }) + +formData.tc_amount = computed(() => { + return (Number(formData.sk_amount || 0) + Number(formData.other_fee || 0)) * (formData.tc_rate / 100) || 0 +}) + //打开弹窗 const userclick = async (e: any) => { showDialog3.value = true @@ -118,6 +123,7 @@ const formRules = reactive({ // 获取详情 const setFormData = async (data: Record) => { + delete data.tc_amount for (const key in formData) { if (data[key] != null && data[key] != undefined) { //@ts-ignore diff --git a/src/views/project_follow_up/edit.vue b/src/views/project_follow_up/edit.vue index 8990511..fec331c 100644 --- a/src/views/project_follow_up/edit.vue +++ b/src/views/project_follow_up/edit.vue @@ -113,15 +113,6 @@ import Popup from '@/components/popup/index.vue' import { apiProjectFollowUpAdd, apiProjectFollowUpEdit, apiProjectFollowUpDetail } from '@/api/project_follow_up' import { useDictData } from '@/hooks/useDictOptions' -// 上传文件 -import annexUpload from "@/components/annexUpload/index.vue" -const handleAvatarSuccess_four = (response: any) => { - formData.annex ||= [] - // @ts-ignore - response.code != 0 ? formData.annex.push({ uri: response.data.uri, name: response.data.name }) : ElMessage.error(response.msg); -}; -// 删除上传的文件 -const delFileFn = (index: number) => { formData.annex.splice(index, 1) } const props = defineProps({ project: Object diff --git a/src/views/project_salary_payment/edit.vue b/src/views/project_salary_payment/edit.vue index dbac706..3c797a0 100644 --- a/src/views/project_salary_payment/edit.vue +++ b/src/views/project_salary_payment/edit.vue @@ -121,24 +121,13 @@ import projectDialog from '@/components/project/index.vue' import { toChinesNum } from "@/utils/util"; import { projectsalarypaymentAdd, projectsalarypaymentEdit, projectsalarypaymentDetail } from '@/api/project_salary_payment' import customDialog from '@/components/project_personnel/index.vue' -import type { PropType } from 'vue' import feedback from '@/utils/feedback' import { watch } from "vue" import { projectsalaryDetailLists } from "@/api/project_salary_detail.ts" - -// 上传文件 -import annexUpload from "@/components/annexUpload/index.vue" -const handleAvatarSuccess_four = (response: any) => { - // @ts-ignore - response.code != 0 ? formData.annex.push({ uri: response.data.uri, name: response.data.name }) : ElMessage.error(response.msg); -}; - -// 删除上传的文件 -const delFileFn = (index: number) => { formData.annex.splice(index, 1) } import { useDictData } from '@/hooks/useDictOptions' -const { dictData } = useDictData('salary_payment_type') +const { dictData } = useDictData('salary_payment_type') let props = defineProps({ project: Object }) diff --git a/src/views/task_handling_three_level_review/edit.vue b/src/views/task_handling_three_level_review/edit.vue index 5611d60..a5c2da5 100644 --- a/src/views/task_handling_three_level_review/edit.vue +++ b/src/views/task_handling_three_level_review/edit.vue @@ -191,7 +191,7 @@ - + @@ -231,13 +231,13 @@ - + - +