From 23e66702779f52693b3268c7d72d375351422b01 Mon Sep 17 00:00:00 2001 From: ChenQiuYu Date: Mon, 12 May 2025 17:02:50 +0800 Subject: [PATCH] dev --- src/views/charge/index.vue | 178 +++++++------------------------------ 1 file changed, 33 insertions(+), 145 deletions(-) diff --git a/src/views/charge/index.vue b/src/views/charge/index.vue index 97f709e..9925d8e 100644 --- a/src/views/charge/index.vue +++ b/src/views/charge/index.vue @@ -54,7 +54,7 @@ @totalPriceChange="getOrderTotalPrice" :statusDisabled="statusDisabled==1">
- +
@@ -67,7 +67,6 @@ - ({payInfo: {}}) const formData = ref({ @@ -111,116 +110,6 @@ const delDraft = () => { }) } const settlementRef = ref() -const charge = () => { - - if (checkTraceCode(formData.value.goodsDetail)) { - //保存订单 - saveAndCharge() - } else { - //打开追溯码详情页 - openCheckoutDetail(formData.value.goodsDetail) - } -} - - -const checkTraceCode = (goodsList: any[]) => { - - for (let i = 0; i < goodsList.length; i++) { - const item = goodsList[i]; - if (!item.traceAbilityCodeList || item.shouldNumber != item.traceAbilityCodeList.length) { - ElMessage({ - message: `${item.name}的追溯码采集未完成`, - type: 'warning', - }) - return false; - } - } - return true; - -} - const checkoutDetailRef = ref() - const openCheckoutDetail = (goodsList: any[]) => { - if (!goodsList || goodsList.length == 0) { - ElMessage({ - message: '没有商品信息,请先选择需要售卖的商品', - type: 'info', - plain: true, - }); - return - } - nextTick(() => { - checkoutDetailRef.value.init(goodsList); - }) - } - - const saveAndCharge = () => { - post('charge/save', {data: {...formData.value, doctorId: doctorId.value}}).then((res: any) => { - formData.value.code = res - nextTick(() => { - settlementRef.value?.init(res) - }) - }) - } - const diagnosisSearchRef = ref() - const diagnosisSearchApi = "social/diagnose/search" - const diagnosisShowConfig = [ - { - label: "诊断名称", - prop: "name", - }, - { - label: "诊断编码", - prop: "code", - } - ] - const diagnosisSelect = (list: any) => { - const diagnosisNames = list.map((item: any) => item.name).join(',') - formData.value.diagnosisMedicalRecord.diagnosisDetail = JSON.stringify(list) - formData.value.diagnosisMedicalRecord.diagnosisSummary = diagnosisNames - } - const recordsConsumptionRef = ref("") - const patientCardRef = ref() - const clickItem = async (item: any, status: any) => { - statusDisabled.value = status - formData.value = await post('medical/record/getByDiagnosisCode', {diagnosisCode: item.code}) - //添加追溯码应采字段 - for (let i =0;i { - let list = JSON.parse(formData.value.diagnosisMedicalRecord.diagnosisDetail) - let nList = formData.value.diagnosisMedicalRecord.diagnosisSummary.split(',') - diagnosisSearchRef.value?.init(list, nList); - recordsConsumptionRef.value?.init(formData.value.patientInfo.id); - patientCardRef.value?.init(formData.value.registrationId); - }) - } - const dockerList = ref([]) - const getDockerList = () => { - let query = { - role: 1 - } - post('organization/member/search', {query: query}).then((res: any) => { - dockerList.value = res - }) - } - const orderCompleted = () => { - nextTick(() => { - chargeQueueRef.value?.getOrderList() - }) - } - const orderCanceled = () => { - nextTick(() => { - chargeQueueRef.value?.getOrderList() - }) const saveAndCharge = () => { post('charge/save', {data: {...formData.value, doctorId: doctorId.value}}).then((res: any) => { formData.value.code = res @@ -282,44 +171,43 @@ const orderCanceled = () => { chargeQueueRef.value?.getOrderList() }) - } +} - onMounted(() => { - getDockerList() - list() +onMounted(() => { + getDockerList() + list() +}) +const getOrderTotalPrice = () => { + let totalPrice = 0 + formData.value.itemDetail?.forEach((item: any) => { + totalPrice += item.selectedPrice * item.selectedNum }) - const getOrderTotalPrice = () => { - let totalPrice = 0 - formData.value.itemDetail?.forEach((item: any) => { - totalPrice += (item.selectedPrice*100 * item.selectedNum*100)/10000 - }) - formData.value.goodsDetail.forEach((item: any) => { - totalPrice += (item.selectedPrice*100 * item.selectedNum*100)/10000 - }) - formData.value.preTotalPrice = totalPrice - formData.value.totalPrice = totalPrice - } + formData.value.goodsDetail.forEach((item: any) => { + totalPrice += item.selectedPrice * item.selectedNum + }) + formData.value.preTotalPrice = totalPrice + formData.value.totalPrice = totalPrice +} - const props = { - expandTrigger: 'hover' as const, - } +const props = { + expandTrigger: 'hover' as const, +} - const doctorId = ref('') - const handleChange = (value: any) => { - doctorId.value = value[value.length - 1] - } - - const cardTypeList = ref(Object.entries(psnCertTypes).map(([id, name]) => ({id, name}))) - const doctorList = ref([]) - const sectionDoctorOption = ref('') - const list = () => { - post(apiConfig.OrganizationMemberSearch, {query: {role: 1}}).then((res: any) => { - doctorList.value = res - }) - } +const doctorId = ref('') +const handleChange = (value: any) => { + doctorId.value = value[value.length - 1] +} +const cardTypeList = ref(Object.entries(psnCertTypes).map(([id, name]) => ({id, name}))) +const doctorList = ref([]) +const sectionDoctorOption = ref('') +const list = () => { + post(apiConfig.OrganizationMemberSearch, {query: {role: 1}}).then((res: any) => { + doctorList.value = res + }) +} const getStatus=(status:any)=>{ statusDisabled.value = status formData.value = {