diff --git a/.env.development b/.env.development index 014bf09..295cf73 100644 --- a/.env.development +++ b/.env.development @@ -11,4 +11,4 @@ VITE_UPLOAD_URL=http://39.101.133.168:8828/hljw/api/aws/upload # zhangyong # VITE_API_BASE='http://192.168.3.83:8081/' # 本地 - # VITE_API_BASE='http://localhost:10704/' + # VITE_API_BASE='http://localhost:8081/' diff --git a/src/views/consume/bean/addBeanConsume.vue b/src/views/consume/bean/addBeanConsume.vue index 7e6c655..2b5442e 100644 --- a/src/views/consume/bean/addBeanConsume.vue +++ b/src/views/consume/bean/addBeanConsume.vue @@ -13,6 +13,7 @@ import { utils, read } from 'xlsx' import throttle from 'lodash/throttle' import { useAdminStore } from "@/store/index.js"; import { storeToRefs } from "pinia"; +import _ from 'lodash' const user = ref({}) const getUser = async function (jwcode) { if (consumeForm.value.jwcode) { @@ -47,7 +48,7 @@ const consumeForm = ref({ permanentBean: '', freeBean: '', remark: '', - adminId: '' + adminName: '' }) const formRef = ref(null) const adminStore = useAdminStore() @@ -121,7 +122,7 @@ const deleteConsumeForm = function () { permanentBean: '', freeBean: '', remark: '', - adminId: '' + adminName: '' } } @@ -141,22 +142,46 @@ const handleConsumeForm = async () => { }); console.log('adminData', adminData.value); + await ElMessageBox.confirm( + '确认消耗吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: "primary", + lockScroll: false, + } + ) const result = await request({ url: '/beanConsume/reduce', - data: { jwcode: consumeForm.value.jwcode, permanentBean: consumeForm.value.permanentBean, freeBean: consumeForm.value.freeBean, remark: consumeForm.value.remark, - adminId: adminData.adminId + adminName: adminData.value.adminName } }) + if (result.code == 200) { + ElMessage.success('新增成功') + consumeForm.value = { + jwcode: "", + permanentBean: '', + freeBean: '', + remark: '', + adminName: '' + } + }else{ + ElMessage.error(result.msg) + } } catch (error) { console.log('金豆新增充值失败'); ElMessage.error(error.message || '操作失败'); } } +const throttledHandleConsumeFormt = _.throttle(handleConsumeForm, 5000, { + trailing: false +})